1

I would like to change a Magento website, but before I do that I would like to create a local copy (not online) to make some changes without doing any mistakes, see the results (as a perfect copy of the real website). If in case, I would be satisfied with these changes, I would like to add them to the website in real-time. The company who developed it is no longer in contact with me. Is it possible to create a test version of the website? Someone did it before in an easy way?

I tried to transfer my website from remote to my local server but I found a lot of problems and errors on importing a sql 100MB db on phpmyadmin using the comand line 'mysql -u root -p test < mysqldatabase.sql' on command prompt. There is an easier solution instead to move the Magento website on the local server?

  • what error are you getting? – Shyam Krishna Sreekumar Mar 3 '16 at 9:12
  • Actually first of all I exported the db .sql from the website magento, through phpmyadmin; then, I tried to import it again on an empty one which I created in phpmyadmin. I am getting an error when I import the database .sql on the empty one. I get this error ERROR 1451 (23000) at line 1476: Cannot delete or update a parent row: a foreign key constraint fails The db .sql which I exported was created from Magento meanwhile the website was created. So I don't know how to write or work with. – Silia Mar 3 '16 at 9:14
1

If the problem is not solved - you can use vagrant .

I had a lot of problem with MAMP,WAMP,XAMPP and all of this and vagrant give me a solution for all the installation problems

https://github.com/rjbaker/simple-magento-vagrant

you can use MySQLWorkbench and do import for your DB with GUI

  • Is Vagrant just for Ubuntu? – Silia Mar 3 '16 at 10:50
  • I have not Ubuntu and I really don't know how to use it. There is another solution :(??? – Silia Mar 3 '16 at 10:54
  • you can use any linux OS you wanted.The file will be on your local computer... every time you change a file at your file system localy-it will be sync with the box – Goldy Mar 3 '16 at 16:27
0

I've also had this issue when importing a mysqldump locally, try doing the import through the command line. If you are on windows browse to your XAMPP or WAMP folder where mysql.exe is located, copy your sql file there and then import with the following command.

mysql -u root -p[root_password] [database_name] < dumpfilename.sql

This usually solves it for me, but don't know if i have ever done it with a db backup over 100 MB. Don't forget to change the web/secure/base_url and web/unsecure/base_url to http://localhost/yoursite in core_config_data table, this can be done through phpmyadmin.

Lastly also update your app/etc/local.xml with your local settings.

  • I used already the command line as you suggested me but it always gives me the same error ERROR 1451 (23000) at line 1476: Cannot delete or update a parent row: a foreign key constraint fails. Moreover I don't really understand what do you mean with that changing that you suggested me can you be more clear please ? – Silia Mar 3 '16 at 10:16
  • but I found a lot of problems and errors on importing a sql 100MB db on phpmyadmin using the comand line 'mysql -u root -p test < mysqldatabase.sql' on command prompt. I thought you meant you ran this command through the SQL tab inside phpmyadmin, my suggestion was to run the command on the terminal. The changing part was in reference to the url of site which is stored in the database. For local.xml it is the nodes inside <connection> which needs to reflect your local settings. – belfort1 Mar 3 '16 at 10:33
  • No actually I ran the command line already on the terminal and I get that ERROR anyway. – Silia Mar 3 '16 at 11:04
  • ERROR 1451 (23000) at line 1476: Cannot delete or update a parent row: a foreign key constraint fails Do you get any info about which rows fail? – belfort1 Mar 3 '16 at 12:28
  • see this question: link – belfort1 Mar 3 '16 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.