Migration of wordpress files to LEMP server, I cant find my pages, and images but themes and plugins are present

Posted May 25, 2016 3k views

I just installed Wordpress to a LEMP server and imported my archived database into the the new database

I have also transferred my wpcontent folder which I unzipped into my wordpress folder using
sudo unzip -d /var/www/html

My problem is that my theme files and plugins all imported successfully but I cannot see my pages , posts or media files on my website, even though I can see the images in the uploads folder when im viewing my wordpress folder via Winscp

How can I have a complete migration of my website

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Pages posts and the location of uploaded images are all managed by the database so it sounds like you ran into an issue either with that import or with your wordpress configuration.

Since you aren’t seeing any DB connection errors my first guess is that there is a difference in the table prefix setting. Take a look at your database and make sure that the table prefix (or lack of one) is reflected in your wp-config.php file

$table_prefix = ‘wp_’;

Also, make sure that your connection settings in wp-config.php are set correctly.

  • oh!, wow!, thank you so much you are genius....what do you advice that I do, destroy the droplet and start the installation afresh?

    I just changed the prefix to “lp”, but Im yet to see the missing pages…or do I have to drop the database and import the entries again?

    Thank you!

    • I would recommend just dropping the current database and re-creating it. There shouldn’t be a need to completely recreate the droplet.

      mysql -uroot -p

      This will open a mysql prompt after prompting you for a password (this is the root MySQL password).

      DROP DATABASE your_db_name;

      Make sure you have the semi-colon at the end as this is how MySQL knows you’ve completed the current command.

      You can then use exit to leave the shell and import your database as you originally did by first creating a new empty database and then pulling in the content of your .sql file.

@ryanpq I had to recreate my droplet to find the issue, I think it has to do with the database file I am importing

I tried to replicate my website on my notebook using xampp and it worked perfectly when i imported a zipped version of the database(.sql.gz)

Now when i try to import the zipped version into digitalocean using the command

“mysql -h localhost -u databaseuser -p databasename < backup_db.sql.gz ”

I get this error

“ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’?” ’ at line 1

I went back to import the unzipped version(.sql) and it worked, my theme folders and plugins were uploaded but I cannot find my posts or pages or media files

Please how can I troubleshoot this?, as I have searched Google for a solution without success