- Login to your local phpMyAdmin, select the database from the dropdown. Click on the Export tab:
- Under the Export tab, Export section, click Select All
- Under the Structure field, check “Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT”
- Check Save as File
- Then click Go and it will prompt you to download a SQL file
- Open the exported SQL file in a text editor substitute all local URLs with the remote URLs, eg:
replace: http://localhost:8888/crp with: http://18.104.22.168/~porcaroo/crp
- ALSO: Make sure any hard coded and relative paths are changed. For example, if you changed the name of a database on the local machine from “subway” to “nycsubwayexplorer” make sure all references like /subway/ are changed to /nycsubwayexplorer/
- Import database to remote server:
- Login to your server cPanel, go to MySQL Databases, create a new database and assign a user. Delete it if it already exists. Now go to phpMyAdmin, select the database (the one that was just created) from the dropdown, click on the Import tab, browse the SQL file and click Go.
- Give the new user all permissions
- Copy the local wordpress installation to the remote server
- Modify the wp-config.php file to be what the server wants. I actually have been keeping a wp-config,php.local and a wp-config.php.remote and then copying them to wp-config.php as appropriate.
- I have been keeping everything the same in the wp-config.php for each new database I create except the database name, and then I regenerate the authorization keys