0

I tried to move an existing Magento 1 instance to our development server.

  • Moved .zip to FTP
  • Extracted files on FTP
  • Imported database (SQL)
  • Changed DB credentials in app/etc/local.xml
  • Changed Base URL's in database
  • etc...

--> I used this site as a reference. <--

But when I visit the site through the web browser Magento tries to reinstall and throws an error:

Error in file: "/public_html/app/code/core/Mage/Core/sql/core_setup/install-1.6.0.0.php" - SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'core_resource' already exists, query was: CREATE TABLE core_resource

I expected to see the backed up website. How can I make sure the install doesn't run and the website displays without Magento trying to re-create every DB?

3
  • It might be issue of wrong database connection. please check your local.xml file and database are correct or not. Commented Apr 16, 2018 at 9:18
  • Thanks @Chirag. The SQL dump turned out to be incomplete. That messed up everything. We asked the other company for a new backup.
    – Rick
    Commented Apr 17, 2018 at 7:36
  • Cool:) Enjoy... Commented Apr 17, 2018 at 8:29

1 Answer 1

0

The core_resource table is a table which Magento keeps records of all installed modules and version numbers. When a module is updated, it updates the version number here also. Create table will be triggered if the module can't read that part of the database typically.

Couple of things to check;

Ensure your MySQL user has full access to the database in question.

File permissions of app/etc/local.xml - if not readable, Magento will take you to the installer.

Execute the following in Magento root directory via ssh, if you want to correct file permissions;

find ./app -type f \-exec chmod 644 {} \;
find ./app -type d \-exec chmod 755 {} \;

Also, ensure the files are owned by your web user, in Magento root dir (assuming user and group are www-data);

sudo chown -R www-data:www-data .

You can also try re-import database, using commandline;

mysql -u USER -p DATABASENAME < FILENAME.sql

Edit:

I also highly recommend n98-magerun (https://github.com/netz98/n98-magerun) and then running the command n98-magerun sys:setup:run - this will run all setup scripts and populate the core_resource.

3
  • Hi @Ricky, Thanks for your answer. Sadly it's not working yet. Strange thing is... I can't find the 'core_resource'-table in the backup SQL file. Somehow the table got created, but it is empty. Any idea how this is possible?
    – Rick
    Commented Apr 16, 2018 at 12:11
  • Yes, Magento will create the table if it doesn't exist via the core setup module. You could try dropping the core resource table again and re-loading your magento instance up, at which point Magento will try to re-create this table. Commented Apr 16, 2018 at 12:43
  • 1
    Thanks again @Ricky. It turned out to be an incomplete SQL dump. So it was never going to work... But thanks for your answers! It was very informative.
    – Rick
    Commented Apr 17, 2018 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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