Wordpress migration and problems [mysql backup Import and Export] [Fixed Link 404] And wordpress404
There are two general problems: apache configuration and mysql export and import. And some problems and solutions encountered after migration.
Machine A is the old server, machine B is the new server, machine A uses Appserv, and machine B uses wmap. It is A little different when configuring multiple sites.
In addition to httpd. conf
Include conf/extra/httpd-vhosts.conf
LoadModule rewrite_module modules/mod_rewrite.so
Configure directories for multiple sites in httpd-vhosts.conf
<VirtualHost *:80> ServerAdmin xieecjtu@163.com DocumentRoot "C:/wamp/www/wp" ServerName B.com ServerAlias www.B.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common<Directory "C:/wamp/www/wp"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory></VirtualHost><VirtualHost *:80> ServerAdmin xieecjtu@163.com DocumentRoot "C:/wamp/www/" ServerName www.A.com ErrorLog "logs/dummy-host2.x-error.log" CustomLog "logs/dummy-host2.x-access.log" common<Directory "C:/wamp/www/"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory></VirtualHost>
The following section shows the newly added settings for wmap settings.
<Directory "C:/wamp/www/"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory>
There are many methods to get the website source code from machine A to machine B, ftp
Machine A backs up the corresponding db with mysqldump and downloads it to machine B through ftp. You must set the character set. Otherwise, an error will occur when you import the data to machine B.
Mysql.exe-uroot-p *****-default-character-set = UTF-8 mydb mytable> mytable. SQL
Run mysql-uroot-p-default-character-set = utf8 mytable <mytable. SQL on machine B.
Create the mytable database on the machine B in advance. Note that the database code must be consistent with the original one.
This problem often occurs when navicat is used for backup and restoration. Probably because of the encoding.
After the wordpress migration, if the homepage is normal and the page in the article is 404 incorrect, it is caused by fixed links.
1. The write permission must be enabled for. htaccess. In this way, wp will automatically overwrite. htaccess when you customize the permanent link of wp. Delete or manually override. htaccess is because it has no write permission.
2. Find the httpd. conf file in the APACHE file, remove the # Before # LoadModule rewrite_module modules/mod_rewrite.so, and load the rewrite module.
3. Check whether AllowOverRide is set to None by default in the httpd. conf file of the APACHE file. If yes, change it to All. Or modify the vhost segment where wordpress is located and add <Directory/wp path/> AllowOverride All </Directory>
Go to the wordpress background, confirm the fixed link, and rewrite the. htaccess file.
Restart apache.
View