By notslow
Usually if I was stuck, I would make the change by changing wp_options table in phpmyadmin. But I cannot access it because phpmyadmin was on the domain.
Can someone show what could be done to get to the new domain through SSH, hopefully or some other way?
Also, for Openlitespeed droplet, any idea how to access file manager other than SSH?
Thanks in advance.
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!
HI @notslow,
It seems you’ll indeed need to change the settings from your database.
For your first question, I have two suggestions.
Install phpMyAdmin. There is a really good article on how to do it here at DigitalOcean - https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-18-04
Change your options directly via your mysql shell. To do so, you can ssh to your server
ssh root@IpOfYourDroplet
mysql
use databasename;
select * from wp_options;
Once you are sure, you are in the right database, you can perform your update query and change your website’s address
UPDATE `table_name` SET `column_name` = `new_value' [WHERE condition];
Regarding your second question, if you wish to have a GUI, you’ll need to install some kind of a web panel on your droplet otherwise, you’ll need to use SSH.
Regards, KDSys
Hi @notslow,
You should still able to have the access to the IP with phpmyadmin url. Then change both siteurl and home values from table wp_options.
If you want to update it from SSH console: Login to the mysql and use the database, e.g. wordpress
update siteurl value by:
UPDATE `wp_options` SET `option_value` = 'http://example.com' WHERE `wp_options`.`option_id` = 1;
update home value by
UPDATE `wp_options` SET `option_value` = 'http://example.com' WHERE `wp_options`.`option_id` = 2;
Be sure to substitute the your domain for http://example.com
Best, Eric
Hello there,
If you’ve already updated the Home and Site URLs from the WordPress admin panel then you can take the next step and update all the references for the old domain name in the database to match the new domain.
**Note:**Please before you proceed take a snapshot of the droplet and also create a backup of the site (both files and database). This will ensure that if something goes wrong you can easily restore your site or droplet if needed
There are a few ways to update the references in your database and it’s totally up to you which one you’ll choose. You can either change them manually if they’re not many or use an automation tool like a plugin or an external app.
One of the external apps that I’ve used and I know for sure that it’s working okay is: https://interconnectit.com/products/search-and-replace-for-wordpress-
You need to upload the script in your public_html folder and access it in your browser, then you’ll need to fill in your database details and enter the old name (IP address or domain) and the domain name you want to use. Then you can first use the dry-run option and if there are references that need to be updated you can then run the script and update them.
Also, an alternative way is to use a plugin called “Duplicator” it will update all of the paths and references from the dev domain to the main domain. This is why we usually recommend using a plugin called: Duplicator. The plugin will generate a backup for your website’s files and database. Then when you import the files to the new domain, all of the references for the old domain name will be updated properly with the correct ones.
Another option is to use the All-in-One WP Migration plugin. The plugin will do the replacement for you during import. You do not need to use any additional database search and replace
Once this is done you can check the site for any errors as there might be some hardcoded references for the domain name in the files like paths to directories, files and etc.
Hope this helps!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.