Moving an localhost site to an EMPTY online database I would do as follows:
Create a backup of the localhost WP-site:
- Make a backup of the files of your localhost site, using the explorer or such.
- !!VERY IMPORTANT!!
Make a backup of the CONTENT of the localhost site
- dashboard > tools > export > all content > download exportfile
- If required: confirm installation of export tool and run the export
You will need this to transfer your content, later on.
You now also have a fallback position, should things go wrong!
NOTE!!! Make these backups every time BEFORE you make changes!
Repairing problems becomes much easier!!
== == ==
- Online: all you need to do is install / copy wordpress to the webhost server using FTP such as filezilla.
- create a database on the server / ask the webhost to provide one
- In a browser: ‘https://www.mydomain.com’, to start the WP-install.
- After the WP-install, check if all is well.
- !!IMPORTANT!!Now make a backup of the
wp-config.php
-file of the NEW online install
== == ==
- Copy all files and folders [backup above]of your localhost site to your online site, OVERWRITING the new.
- Copy the backed-up NEW online
wp-config.php
back onto to the online site, overwriting the existing one
- Now restore the content of the localhost, onto the online site, by restoring the database backup, made at the top of this list
- Go to the online site:
Dashboard > Tools > Import > wordpress > choose the exportfile from your computer, and ‘upload file and import
- If required: confirm installation of import tool and run the import
You should now have a online version of your old localhost site.
== == ==
The other obvious way is to use
phpmyadmin [in wamp / mampp and lamp-servers] to create an exportfile:
- open your localhost database using phpmyadmin
- select the correct database
- click the EXPORT-tab
- select quick option; and ‘sql’ as the filetype to be stored to.
- start the export, save the file on your pc
- Online: access the database of the site using phpmyadmin [supported by most webhosts]
- click the IMPORT-tab
- import the sql-file, just created;
Follow instructions on screen
DONE!
- Problem? – check `wp-config.php [online site] to see if you’re connected to the correct databse]