By psymessick
It seems digital ocean doesn’t allow you to download a full local copy of the site, and it isn’t clear how to point mysql to another webhost either. Any tips?
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!
Hey there
Please check out the article below ,it might help http://www.wpbeginner.com/wp-tutorials/how-to-move-wordpress-to-a-new-host-or-server-with-no-downtime/
DigitalOcean does not block anyone from migrating their websites / applications around - WordPress included.
There are a few ways to do so - this is one.
cd /PATH/TO/WEBROOTDBNAME=$(grep DB_NAME "wp-config.php" | cut -d "'" -f 4); \
DBUSER=$(grep DB_USER "wp-config.php" | cut -d "'" -f 4); \
DBPASS=$(grep DB_PASSWORD "wp-config.php" | cut -d "'" -f 4); \
mysqldump -u${DBUSER} -p${DBPASS} ${DBNAME} > ${DBNAME}.sql
This will drop a copy of your database into the same directory as your wordpress installation. Please note this works only for a standard WordPress installation - This can also be done quite easily with phpMyAdmin if it is available.
zip -r ../html.zip /PATH/TO/WEBROOTThis will place a *.zip archive one directory up.
move the archive to the new server scp ../html.zip USERNAME@IP_OR_HOSTNAME:/PATH/TO/WEBROOT
Leave your droplet
Within the new host create your new database using whichever tool is available or proffered
ssh into your new host and cd /PATH/TO/WEBROOT
unzip html.zip -d ./
copy the old wp-config cp wp-config.php wp-tempfile - we are only going to use this temporarily
edit the wp-config.php file updating the database connection details with that of your new host
upload the database
OLDDBNAME=$(grep DB_NAME "wp-tempfile" | cut -d "'" -f 4); \
DBNAME=$(grep DB_NAME "wp-config.php" | cut -d "'" -f 4); \
DBUSER=$(grep DB_USER "wp-config.php" | cut -d "'" -f 4); \
DBPASS=$(grep DB_PASSWORD "wp-config.php" | cut -d "'" -f 4); \
mysql -u${DBUSER} -p${DBPASS} ${DBNAME} < ${OLDDBNAME}.sql
rm -v wp-tempfile html.zipPlease note that this may need to be adjusted to suite your server setup for the source and destination server and wordpress installation - i.e. you may need to install and configure NGINX/APACHE, MySQL/MariaDB etc…
Another solution is to use something like this
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.