wp-admin can’t access after moving

I have moved my WordPress site to another domain and a different server.

I have just edited the wp_config.php file and database connection information have been changed. The table_prefix remains the same because I am using the same table.

Read More

I have also changed the wp_posts and wp_option.

I still have this error message:

You do not have sufficient permissions to access this page

I am also unable to access the wp-admin after moving.

How can I fix that?

Related posts

Leave a Reply

3 comments

  1. If you are moving your domain without changing the Home and Site URLs of your WordPress site you can follow the below guidelines as prescribed by the wordpress codex.

    1. If database and URL remain the same, you can move by just copying your files and database.
    2. If database name or user changes, edit wp-config.php to have the correct values.
    3. If you want to test before you switch, you must temporarily change “siteurl” and “home” in the database table “wp_options” (through phpMyAdmin or similar).
    4. If you had any kind of rewrites (permalinks) setup you must disable .htaccess and reconfigure permalinks when it goes live.

    EDIT (if your site url has also changed, well i am only phrasing from the codex site)

    Moving a website and changing your domain name or URLs (i.e. from http://example.com/site to http://example.com, or http://example.com to http://example.net) requires the following steps – in sequence.

    1. Download your existing site files.
    2. Export your database – go in to mySQL and export the database.
    3. Move the backed up files and database into a new folder – somewhere safe – this is your site backup.
    4. Log in to the site you want to move and go to Settings > General, then change the URLs. (ie from http://example.com/ to http://example.net ) – save the settings and expect to see a 404 page.
    5. Download your site files again.
    6. Export the database again.
    7. Edit wp-config.php with the new server’s mySQL database name, user and password.
    8. Upload the files.
    9. Import the database on the new server.

    When your domain name or URLs change there are additional concerns. The files and database can be moved, however references to the old domain name or location will remain in the database, and that can cause issues with links or theme display.

    If you do a search and replace on your entire database to change the URLs, you can cause issues with data serialization, due to the fact that some themes and widgets store values with the length of your URL marked. When this changes, things break. To avoid that serialization issue, you have two options:

    1. Only perform a search and replace on the wp_posts table.
    2. Use the Search and Replace for WordPress Databases Script to safely change all instances.
  2. Make sure that the web server is allowing you to view the page itself, and look in the httpd.conf or .htaccess file for the directory that the main WordPress script lives in.

    Make sure that the WordPress files have the correct permissions. If you just copied them over, then the user that needs to accesses them (apache on many typical LAMP installs, but yours may be different) is able to.

  3. If you have already copied all your files and moved all of it to the new directory, then all you need to do is set your site url, home url.

    So for example, if you are working on wordpress locally, you might have had your original URL to something like this:

    http://localhost/wordpress
    

    and your new URL might be something like this:

    http://wordpress.local
    

    In the case above, you would need to modify your settings in the database.

    Database settings:

    Go to the wp_options table, and look for the column named option_name, look at the field that says siteurl and home. You will notice that next to them in the option_value field you had your old URL. Change this to your new URL, and you should be good to go.

    Hope this helps.