简体   繁体   中英

Manually transfer WordPress database from domain to another domain with postname in permalink

I'm new to WordPress. I needed to transfer a WordPress site from domain to another domain. In addition, the previous WordPress site was in trouble. So I did not have access to the dashboard. So, I decided to install a new WordPress in new host and domain then transfer Data Base. But I forgot to get Premlink out of postname. WordPress pages are not displayed right after import and I have 404 error. please guide me. This is very important to me.

This is actually a very common issue. The steps you should take is in the following order:

  1. Be sure your server honors the .htaccess file ( /etc/apache2/sites-available/your-domain-probably.conf There should be something like

    <Directory /var/www/your/path> AllowOverride All </Directory>
  2. Go to your /wp-admin -> settings -> permalinks select your type and then click save even if your type is already selected

  3. If the steps above be sure that your web server has privileges to write in your wordpress installation directory. Assuming you use apache2 up until now that would be

    sudo chown -R www-data:www-data /var/www/your/wordpress/directory sudo chmod -R 755 /var/www/your/wordpress/directory

    Hope i was helpfull !

In the database, you probably need to update the site url and the home url. You also need to move the wp-content directory.

The answer is here:

https://codex.wordpress.org/Changing_The_Site_URL

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM