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.

Bobby Iliev
Site Moderator
Site Moderator badge
August 16, 2022

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

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel
Get started for free

Enter your email to get $200 in credit for your first 60 days with DigitalOcean.

New accounts only. By submitting your email you agree to our Privacy Policy.