Home >CMS Tutorial >WordPress >How to migrate WordPress database
If you want to know more about wordpress, you can click: wordpress tutorial
## How to migrate the WordPress website built in the local environment from the local to the network space or network server after it is completed? First of all, please make sure that you only made the template file in themes when you built the website locally. If you just changed the template yourself, you can choose to reinstall the wordpress version when moving the website to the server, or not re-install. But if you modify the template files in themes and modify the external WordPress program files, then be sure not to reinstall WordPress on the server. Use the ftp tool to upload the entire program file of your local wordpress website to your space or server. Then open the browser and enter 127.0.0.1/phpmyadmin to enter the visual database management interface.Export the database file used by your local wordpress website.
Open the data file you just exported with notepad,Remove some content at the top of the file until the first "CCREATE TABLE" appears, as shown below:
Then remove the ##/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
that appears at the end of the file
Log in to your network space or network server, Enter your network database
(Meicheng Internet clicks Manage Database on the database management page). If your network database has the "Import" function shown in the first picture, then you can directly import your local database file to the network database through the import method. If the network database does not have the "import" function, then you can use the "sql" that appears in the first picture to import data.Enter your database and click "sql". Here is the execution of the sql statement. Open the data file you just exported and modified locally, use Ctrl A to select all the file contents, then copy it to the text box of the sql statement insertion page you just opened, and click Execute.
Use a browser to access your domain name to see if it is fully accessible. Here you have to log in to the website backend and replace the two domain names that appear in the general settings in the settings with your real website. domain name. In this way, your WordPress website has been completely migrated.The above is the detailed content of How to migrate WordPress database. For more information, please follow other related articles on the PHP Chinese website!