0

I am moving a website from shared hosting to a VPS but I am unable to import the database correctly as I am getting a 500 error on my website. I will list the steps I have taken below, please could you check that I am not missing anything, thanks.

  1. I set up the VPS on Digital Ocean with the one click WordPress install and I set up the WordPress install etc.
  2. Uploaded the theme and plugins to the correct folders on the sftp.
  3. Created a new database on the VPS using Sequel Pro and then imported the old database to it.
  4. Accessed the new database through mysql on the terminal and ran the following commands;

    UPDATE sw13_options SET option_value = replace(option_value, 'https://olddomain.co.uk', 'http://newdomainIP') WHERE option_name = 'home' OR option_name = 'siteurl';

    UPDATE sw13_posts SET guid = replace(guid, 'https://olddomain.co.uk','http://newdomainIP');

    UPDATE sw13_posts SET post_content = replace(post_content, 'https://olddomain.co.uk', 'http://newdomainIP');

    UPDATE sw13_postmeta SET meta_value = replace(meta_value,'https://olddomain.co.uk','http://newdomainIP');

    UPDATE sw13_options SET option_value = replace(option_value, 'https://olddomain.co.uk', 'http://newdomainIP') WHERE option_name = 'home' OR option_name = 'siteurl';

    UPDATE sw13_posts SET guid = replace(guid, 'https://olddomain.co.uk','http://newdomainIP');

    UPDATE sw13_posts SET post_content = replace(post_content, 'https://olddomain.co.uk', 'http://newdomainIP');

    UPDATE sw13_postmeta SET meta_value = replace(meta_value,'https://olddomain.co.uk','http://newdomainIP');

  5. Opened the config.php file and updated the database name to the new one and changed the table prefix to sw13_ and defined the site url.

Have I made a mistake or have I not done something?

Bárbara Peres
  • 633
  • 1
  • 8
  • 24
Reece
  • 2,050
  • 6
  • 24
  • 60
  • You could set the display_errors on your php settings to true to get the error? – Alex Oct 17 '18 at 13:41
  • Alternatively (this is what I do) install this on both https://en-gb.wordpress.org/plugins/all-in-one-wp-migration/ - export from your shared hosting - install vanilla WP on your VPS - then import the created file. Easy. – Alex Oct 17 '18 at 13:42
  • @Alex thanks for the suggestions. I'm going to try do it with a plugin if I cannot do it this way, I'd just like to learn how to do this. Could you give me more information on the display_errors? – Reece Oct 17 '18 at 13:46
  • https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display - this – Alex Oct 17 '18 at 13:59
  • Also worth reading: [Debugging in WordPress](https://codex.wordpress.org/Debugging_in_WordPress). – cabrerahector Oct 17 '18 at 14:30

0 Answers0