Relocate your WP website

Move your WordPress website anywhere in 10 minutes via an SSH shell with access to your website files directory and database.

Current URL: example.com/wordpress
Where to: example.com

Or, complete URL change, it doesn’t matter using this method.

Export your WordPress database.

mysqldump -u loginID -p example.com_wp > example.com_wp.sql

Now bust out a little sed.

cat example.com_wp.sql | s/example.com\/wordpress/example.com/g > new.sql

Now import your db sed edits.

mysql -u loginID -p example.com_wp < new.sql

Now move your directory files.

cd /var/www/example.com/wordpress/
tar cvf all.tar *
mv all.tar ../
cd ../
tar xvf all.tar
rm ./wordpress
rm all.tar

Done. Visit example.com


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *