ddev Database Import not showing up in phpMyAdmin - ddev

I've setup ddev for a Silverstripe PHP project, with existing files. I can get to the site. I can get to the phpmyadmin link given by ddev describe and I have ran ddev import-db successfully.
When I go to the site's ddev link, I get missing table errors and the phpMyAdmin is not showing any of the imported data.
What am I missing to get the database that the CLI is using to be the one the browser based site & phpMyAdmin are using?

Related

magento setup:upgrade showing could not validate a connection to elastic search

I am cloning a magento repo. after i did composer update and then bin/magento setup:upgrade it is giving me the following error
-- Could not validate a connection to elastic search. no alive nodes found in your cluster --
the elastic search is up and running. If i install a fresh magento project (2.4.3) setup:upgrade command works fine.
I also checked the status of the elastic search and it showed as below pic
elastic search status
I have already checked a previous thread relating to not connecting to elastic search. have tried every answers there and I believe that thread was a different problem.
Are you using a database dump from another enviroment?
Check your database entries for elasticsearch host:
SELECT * FROM magento.core_config_data
where path like '%elastic%'
you could well have hostname set to something other than your local setup. check keys:
search/engine/elastic_host
catalog/search/elasticsearch6_server_hostname
etc
Its seems to be a elasticsearch connection problems,
Verify the core_config_data according the #Andrew response.
If you are using docker, maybe can be a permission problems:
A permission 777 in your docker folders of your project can helps (of course, in local environments only), specially which has elasticsearch files (volumes and other configuration)

Can I use Composer instead of Apache to use localhost:8000 etc?

I want to set up the environment for my laravel project to work using a simple method. Apache is so far giving me some trouble in that the home page is not loading and throwing an error.
I have setup an Apache virtual server which is not working as expected.
No codes related to this one.
Set up the environment for my laravel project using

Running Laravel's migration command on AWS Elastic Beanstalk

I'm having a hard time deploying a Laravel app for test purposes on AWS Elastic Beanstalk.
Followed all sources i could find in web including AWS documentation.
Created a Elastic Beanstalk environment and uploading an application is straightforward as long as i do not include .ebextensions and the .yaml file in it.
Based on Maximilian's tutorial i created init.config file inside .ebextensions with contents:
container_commands:
01initdb:
command: "php artisan migrate"
Environment gets to a degraded state as it finishes to update and i get the following logs:
[2018-11-20T23:14:08.485Z] INFO [7969] : Command processor returning results:
{"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"(TRUNCATED)...y exists\")\n/var/app/ondeck/vendor/laravel/framework/src/Illuminate/Database/Connection.php:458\n\n2 PDOStatement::execute()\n/var/app/ondeck/vendor/laravel/framework/src/Illuminate/Database/Connection.php:458\n\nPlease use the argument -v to see more details. \ncontainer_command 01initdb in .ebextensions/init.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI","returncode":1,"events":[]}],"truncated":"true"}
I have been trying different .config files from other instruction resources but none of them seems to work.
I'm running:
Laravel Framework 5.7.5
EB Platform uses PHP 7.2 running on 64bit Amazon Linux/2.8.4
RDS uses MySQL 5.6.40
I really do not know what is going on and would appreciate if you could give any suggestion.
I finally found my way out. Providing some documentation for anyone that hits the same issue.
What I was trying to do...
My main objective was to test a Laravel 5.7 application on a live AWS Elastic Beanstalk (EB) server. I was also in need of a way to visualize data using phpMyAdmin, a tool that fits my need. This is a very simple CRUD app just for learning the basics of both technologies.
What I did (worked)
Followed the normal workflow of creating an EB application mainly using the web console.
Name the application
Chose PHP as a platform
Start off with a base application (do not upload code yet)
Hit configure more options
In security card select your key pair and save. (This is valuable for SSH'ing on your server)
In the database, the card creates an RDS instance. Select whatever options that fit your needs and set a username/password.
Create environment.
After a while, you should have all resources created by EB (EC2 and RDS instances, security group, EIP, Buckets, etc) in the app environment.
Preparing your Laravel application is a straight forward process. You must not forget to change config/database.php to read server variables. My approach was to define them at the start of the file.
The main sources of troubles reside in configuring your server instance to include all software and configuration needed by your app and specific needs. This is done by including a .yaml file inside .ebextensions folder. This folder should reside in the root directory of your Laravel application. It's also a good idea to check your syntax before submitting another app version to EB. As per my needs, I used this script which basically installs phpMyAdmin as I deploy a new version. Specifically for this startup script, environment variables should be defined, namely $PMA_VER, $PMA_USERNAME, $PMA_PASSWORD for phpMyAdmin to work. You can create more environment variables in the software tab of your EB configuration page. Read the docs.
Another detail that might cause issues in running commands at startup using YAML script (specifically migration) is caused by Laravel and MySql versions. As for example, I am using Laravel 5.7 and the default MySQL version option in EB RDS creation wizard is something like 5.6.x. This will throw issues of the type:
Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`))
If this is your scenario, despite you should have already googled and sorted out that adding the line of code Schema::defaultStringLength(191); to the boot function of your app/Providers/AppServiceProviders.php file will do the trick.
You can do a typical migration passing the script:
container_commands:
01_drop_tables:
command:
"php artisan migrate:fresh"
02_initdb:
command:
"php artisan migrate"
This will drop existing tables avoiding conflicts and create a new one based on your code. You can read more logs from your server by SSH'ing and getting content of /var/log/eb-activity.log.

Artisan command affecting wrong database

I have two laravel apps, the first is used as a Server Management System (SMS) that creates a host on the server. When this host is created it does a git clone to bring in the second laravel app that is used as a CMS for that host.
What I am trying to do is create a plugin within the SMS so that you can just select a check box and it will install the CMS for you when you create a new host. I have most of the code in place and I am testing locally and everything works grand until at the end when I try to install the migrations, when I try to run;
'php artisan cms:update'.
I also tried;
'php artisan migrate'.
What ends up happening is that rather the command being run against the CMS database, it is affecting the SMS's database adding a couple of tables and breaking the SMS database. I have done a 'pwd' and checked to make sure I am in the correct directory;
'/Directory/Directory/host/cms'
As it makes more sense for someone to read all of the code rather than snippets here is a link to the plugin:
CODE LINK
So to clarify what I need is to be able to test the plugin locally so I need the migrations to install into the correct database, and make sure the CMS works before I push to production. If anyone could shed some light on why the migrations is affecting the SMS rather than the CMS it would be greatly appreciated.

how to bring live magento site to localhost without effecting live site

i want a live site to be on local host and without effecting any functionality of live magento site. i have tried many way of doing that but have not get any result from it.
steps i tried are :
1. taken database from magento live site by entering into cpanel(by ftp access) > phpmyadmin > exported all the files to my local machine and i imported all the data to my local phpmyadmin.
2.taken all neccessary files from cpanel > file manager > all files (for example p_html, .htpassword, .trash, access log, etc file and many more) and put it on my local machine and then i put the file in folder and kept it into C:\xampp\htdocs\ all file ( in folder ).
3 Replaced the path of live site with localhost:1234 in the all sql files where applicable taken in step one.
but still not working .
Any help will be appreciated....
Copy your LIVE Magento store to your Local computer:
Download the magento files using any ftp client.
Export the database from live server.
Put the downloaded Magento files in your localhost root folder.
Create a blank database(lets say it 'local-database') in your local computer and import the database backup that you exported from the live one.
Delete/Rename the file app/etc/local.xml
Re-install the Magento using the local-database.
After installation, go to Admin section and then
(i)Flush all cache. (ii)Re-Index all data. (iii)Flush all cache.
That's it. You are done.
N.B. If you have domain specific Modules installed, those modules will not work here.
Seems very simple right. Believe me, it is that simple.
If you face any problem in installing your Magento in localcomputer, here is a post that may come in handy: http://www.insync.co.in/how-to-install-magento-on-wamp-server-localhost-localcomputer/
Steps:
Download the files to the local project folder.
Create a new local DB and import the live database backup/dump.
Update app/etc/local.xml file with local DB parameters(Host name, DB
name, DB username, DB password)
Magento have the project URL saved in 2 places(secure URL and
unsecure URL) in the table core_config_data. We need to update
that in imported local DB to the local URL(9th and 10th record in
the table).
Delete the cache: Delete the contents in var folder(That folder
contains reports and logs too. I assume that you won't need it as
this is a separate installation)
The local copy will most probably work by now but there are possibilities that it would not. Things to do in this case:
If you are getting redirected to the live site, check the .htaccess
file for redirects(For various reasons there may be a redirect
defined in the file)
If you are getting forbidden error, this will come in handy(Usually occurs in linux systems)
There may still be some problems probably theme or module specific. In this case you will need to debug the project and find out what the problem is. Xdebug will come in handy in this situation for boosting the debug process :)
Subrata's solution will conflict with some of the Magento Modules installed and will not allow you to re-install Magento in local. I follow these steps and everything works fine.
Just give a permission (0777) after take a backup to that folder in your local PC
First of all you will have to change the secure and unsecure base_url in your database.
These can be found in the 'core_config_data' table.
Paths:
web/unsecure/base_url
web/secure/base_url
If you want to access your local version of Magento via localhost, you'll have to set localhost as your base_url.
After that you need to clear your cache folder.
EDIT:
To install and run Magento on your local PC using XAMPP, please follow these steps:
http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/installing_on_windows_with_xampp_and_wamp

Resources