Question

Test copy of WordPress site

What can we do to get a test copy of a WordPress droplet?

I have scoured the documents and attempted many ways of configuring a WordPress droplet copy to run a test version of a WordPress site. I can’t get the test site to support logging in on /wp-admin . The following steps seem to work but then the site goes down. After logging in to /wp-admin

Steps:

  1. Get a free domain on no-ip.com (e.g. example.com)
  2. Create droplet from snapshot in Digital Ocean
  3. Copy the droplet IP to the domain in no-ip.com
  4. Open console of new droplet and follow the installation prompts
  5. After the installation, copy the 2 following lines to wp-config.php:
define( 'WP_HOME', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' );
  1. Restart apache with
systemctl restart apache2.service
  1. Configure let’s encrypt for the new domain

a. Enter the command in the droplet console:

certbot --apache -d example.com

b. Reference:

https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04

  1. Update site settings in wordpress database In the Digital Ocean console

     a. mysql -u root -p
    
     b. select * from wordpress.wp_options where option_name = 'siteurl';
    
     c. select * from wordpress.wp_options where option_name = 'home';
    
     d. update wordpress.wp_options set option_value = 'http://example.com' where option_name = 'siteurl';
    
     e. update wordpress.wp_options set option_value = 'http://example.com' where option_name = 'home';
    
             f. update wordpress.wp_options set option_value = replace(option_value, "oldurl.com", "example.com");
    

Anything else we can try to get a test copy of a WordPress droplet?

Cheers


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there,

This is indeed more or less the correct process, so to summarize the steps before that as well:

  • First, you get a backup of your current website including your files and database
  • Then you create a new WordPress Droplet
  • After that you upload your website’s files to the /var/www/wordpress directory
  • Then you restore the database that you’ve backedup initially
  • Finally, you proceed with the step you’ve described.

If this is the case, would you mind confirming what is the exact error that you are getting now that you try to login or access the website?

When the site goes down, what is the exact error that you see and do you get any errors in the logs?

Best,

Bobby