4

I have a weird problem with moving a Wordpress installation to a new server (just the server changes, domain remains the same, I'm currently accessing the site on the new server via the same domain and a hosts-file entry). Although the blog is displaying and I can access the admin area, there are no posts shown. The weird thing is, that the posts screen shows the correct statistics ("All (137) | Published (92) | Drafts (45)") but the posts table says "no posts found". On the frontend no posts are shown, but the "newer/older" links are shown and the archives list the months were posts were created. So it seems to find the posts, but somehow is missing some important information. I tried exporting/importing the DB with mysqldump/mysql on the command line and with phpmyadmin - same issue.

Did anybody experience this problem before?

9
  • Did you change all of the old urls in your database dump to reflect the new url location before importing it into your new site? Mar 20, 2011 at 22:06
  • Well the URL stays the same, I'm just changing the server, so I didn't change anything in the dump file.
    – maff
    Mar 20, 2011 at 23:45
  • Have you modified the table prefix value in the wp-config file by any chance? Mar 21, 2011 at 0:05
  • Nope, table prefix is the same. Copied the files 1:1 to the new server and imported the SQL dump.
    – maff
    Mar 21, 2011 at 21:26
  • 1
    Umm seems to be an issue with my theme. Quite strange, when I import the dump and display the site with another theme, all works fine. As soon as I activate my theme the posts are gone. Even if I deactivate my theme the posts are still gone. So - time for a new theme. Thanks for the help :)
    – maff
    Mar 22, 2011 at 23:22

4 Answers 4

1

Reset permalinks at Dashboard>>Settings>>Permalinks and be sure WP says it was able to make changes to the .htaccess file, or make the changes yourself it fails to write to .htaccess.

Did you change installed directories? I.e., from /wordpress/ to root? If so, see http://codex.wordpress.org/Moving_WordPress

And if you moved to a Windows IIS server, be sure it's set up to handle pretty permalinks: http://codex.wordpress.org/Using_Permalinks#Permalinks_without_mod_rewrite

0

Go into your admin and go to Settings/Permalinks, make sure your links are set as desired and hit save changes. Worked for me.

0

If you were hosting on a Linux box originally, chances are your tar or zip command didn't include .htaccess. Resaving your permalinks option (or copying over your .htaccess) file should fix it.

1
  • .htaccess was copied too. I don't think the .htaccess is the issue as the posts don't get found in the admin interface.
    – maff
    Mar 21, 2011 at 21:28
0

For those of you who migrated to an Nginx server, you will need the following in your conf file to ensure that the permalink ends up being passed in a request with index.php.

location / {
    index index.php index.html index.htm;
    try_files $uri $uri/ /index.php?$args;
}

I migrated from apache2 to nginx recently and this solved it for me.

Source: http://www.lowendguide.com/3/webservers/wordpress-permalinks-with-nginx/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.