Many people like to create and test a new version of their site in a subfolder so that it does not affect their main domain. Once completed, they will want to migrate the new site over to the root directory for the domain. This is very common with WordPress. Follow the instructions below as we guide you on how to do just that with the WordPress CMS.
Make a Backup of your account
Before performing the following procedure, it is a good idea to make a backup of your account prior to making any changes. Learn how to make a backup here: Backup website files in cPanel
Prepare your Wordpress installation for the move
Prior to physically moving the files, you will need to prepare the installation to accept the new URL name.
- Log into your WordPress Dashboard. For example.
- From the main dashboard, go to Administration -> Settings -> General.
- Next, look for the WordPress address (URI): and change it from (example.com/wordpress to example.com)
- Lastly, look for the Site Address address (URL): and change it from (example.com/wordpress to example.com)
Moving your Wordpress from a subfolder to your main folder
After you have made your backup, removed the site files from the builder, and prepared your wordpress files, it is time to move your WordPress to the primary folder.
- Log into your cPanel admin dashboard.
- From the main cpanel area, look for the Files category and then click on the File Manager tool. Ensure you select the checlbox entitled Show Hidden Files.
- Once inside the File Manager, you will want to navigate to the folder you have the WordPress site in. For example, a folder named wordpress.
- You will see a list of all the wordpress files and folders in the right hand panel. Highlight them all and click on the Copy icon from the menu toolbar across the top of the page.
- A popup will appear so you can enter the destination folder. Continuing with our wordpress folder example, it should show as public_html/wordpress. Remove the /wordpress from the destination path so that it simply displays as public_html. Click the Copy Files button.
- This will copy the files up to the public_html folder. Use the File Manager to navigate back to the public_html folder. (You can do this by clicking on the Up One Level button from the toolbar across the top of the right hand panel.)
- You should now see the same files as you have in your wordpress folder.
- You can now delete the old wordpress folder.
Log in and finish the URL details
- Log into your NEW WordPress admin dashboard. For example (example.com/wp-admin or example.com/wp-login.php)
- Go to Administration -> Settings -> Permalinks and ensure the link structure is the same as your new URL.
2013-06-13 6:32 pm EST
The changes you're needing to make for the content is in the database. The easiest thing for you to do is to actually export the database as an SQL file and then edit it - unless you're familiar with making update queries in SQL. I'll list the steps below for what you need to do to make the change using the export option (it's much easier):
1) Login to your Cpanel
2) Go to PHPMYADMIN
3) Select your Wordpress database
your Wordpress database as a SQL file. Make a copy and keep it as a backup.
5) Download the SQL file that was exported to your local computer.
6) The SQL file is a text file, so you can open it in something like notepad, and then run a FIND AND REPLACE. You will need to look for your OLD PATH and replace it with the NEW PATH. The Find and Replace function is built into the editor.
7)When you're finished, save the file. Don't change it to another file format - keep it as a .SQL file.
8)Upload it back to the server.
the changed file back into your server using the PHPMYADMIN.
And that should change the path in the database for you! I hope this helps you with your problem. If you have any further questions or need further assistance, please let us know!
Thanks for answer very quick. Is there any way to find this path making a search in phpMyAdmin?, its a little bit tricky for me, because i don't have knowledge with this.
Thanks in advance,
2013-06-13 6:50 pm EST
You can try going through each table one by one and then looking at the data. You would need to go through all of the tables that have the path and then making the change manually. Otherwise, you need to use an update query using MySQL. If you're not familiar with using MySQL, then follow the steps I have listed, and you will be able to make the change to the database very easily.
The best way to clean your MySQL DB after you move from dev. to production is to install a plugin called
WP Migrate db http://wordpress.org/plugins/wp-migrate-db/
It will search and replace all your directories in all locations, files, posts, tables, etc.
I've used it for my sites I've developed and once I get my site onlin, will post a link, recommend, and donate to them.
I am to "Step 8: You can now delete the old wordpress folder" but it won't let me.
I would like to simply rename it (instead of deleting it), but I get an access denied error, as if it's locked or still "running". I've tried via FTP and through an online interface. FYI, I have an IIS installation.
Is there something I can do to "unlock" this folder (or disable the old wordpress) so I can rename the folder?
Any help is greatly appreciated!
2013-09-23 9:01 am EST
You may have some sort of permissions issue that is not allowing you to make changes to the file. Unfortunately, I don't have much knowledge of IIS as we only run Linux servers but either your hosting provider for the IIS server or Microsoft may be able to provide you with more information on the issue.