Support » Plugin: All-in-One WP Migration » Unable to open file for reading

  • Resolved andi14



    I am trying to move a WordPress website to another hosting provider. The exported file from the old registrar can not be imported. I tried to move the backup to the new file manager and then restore it but it says Unable to open file for reading

    What can I do?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Yani Iliev


    Thread Starter andi14


    Still doesn;t work. I increased the limit and same thing.

    Hope this can help:

    After 3 days of tiresome hours to import my website and tried all the solutions I could find online, I decided to do it manually. Took an hour or two but maybe it can work for you.

    First create a directory to work in.
    1. On your pc, create/choose a directory where you wish your files to be extracted to. For those not proficient in command prompt commands, create this directory in C:\ Let’s call it workdirec

    Now get the files in the directory.
    2. Download wpress-extractor from to the new directory. (workdirec)
    3. Copy your .wpress file to that directory. (workdirec)

    You need to extract the files from the .wpress file.
    4. Open up a command prompt on your pc
    a. Change directory (CD) to the new directory. Type cd C:\workdirec to go to your new directory
    b. To extract your files from the .wpress file – type on the command line wpress-extractor <name-of-your.wpress file>
    c. After extracting, check you workdirec directory and you should see the following:
    ii. Files database.sql, index.php, package.jsn

    It is now time to import these files to your website. The easiest way is to use FTP. You can use your CPanel and copy the files – will take some time though.

    5. Copy the three directories PLUGINS, THEMES, DOWNLOADS to your website’s relevant directories. Do not delete any existing files in the website’s directories. Should you get files which exist, you can replace them.
    6. Copy index.php and package.jsn to your website’s root directory. Index.php will be replaced.

    Now to create the database. In my case, I kept my existing database as a backup of the settings on the website should I need to go back.

    7. Create a new database on your website. For the example I will call it newbase with prefix of newbd. Remember to create a user with password for this database.
    8. On your pc, open the file database file database.sql in a text editor.
    9. Find SERVMASK_PREFIX and replace it with your new prefix. In the example newdb.
    10. It is good to keep the database.sql file just in case something goes wrong. All your data and settings are in it! Save the text file as database1.sql

    Import the data to the new database.
    11. If you use CPanel – go to phpMyAdmin else to your database management system.
    12. Go to your new database. There should be no tables. If any, you can drop them
    13. Click on import and upload database1.sql. Click go.
    14. Your tables will now be created and your data added. Should there be an error (should not be), fix the error. If you get an error that the table does not exist, check for spelling, upper and lowercase. Drop all the tables before you run the sql again.

    Edit your wp-config. You will find it in the root of your website.

    /** The name of the database. Replace your name with the database name.*/
    define( ‘DB_NAME’, ‘newdb’ );

    /** MySQL database username. The name of you user you have allocated to this database */
    define( ‘DB_USER’, ‘username’);

    /** MySQL database password for the user */
    define( ‘DB_PASSWORD’, ‘password’ );

    /** MySQL table prefix Make sure of spelling and UPPER and lower case */

    $table_prefix = ‘newdb__’;

    Activate plugins and theme.
    15. Go to wp-admin
    16. You will see all your plugins. Activate those you use.
    17. Change/activate your theme to the one you have imported.

    Go to you website and it should be live.

    All you need to do if you wish to reverse all this is to change your wp-config to the old database and your website will back to original.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Unable to open file for reading’ is closed to new replies.