• Resolved LightSquare

    (@lightsquare)


    I though it was going to be easy but it really isn’t, not for me.
    Looked at the WP Codex on Migration but, while it’s very valuable info, not that comprehensive about all the things that can happen in-between.

    I changed my Godaddy hosting to a multi-domain, shared plan. I am planing 3-4 WP websites there, no more.
    So WP admin username and pass, CPanel pass, install folder, all have changed, for this single one WP installation I was working on.

    I do have a copy of my whole old WP install folder and a copy of the SQL exported database. There’s about 2 weeks of my own tests, post, tweaks in there that I would like to recover.
    My attempts:
    1. I overwrote the new WP install with the old one – of course a fail.
    2. Tried to add my DB through PHP MyAdmin – fail due to old and new pass and user clash.
    3. I can edit the new wp_config but the passwords are encrypted.

    So it looks to me that:
    I have to manipulate the DB to reflect the new location.
    I have to solve the old/new credentials problem.

    I still feel like I am only scratching the surface of the problem I am in, and I might be better letting go and starting all over.
    Can you please help me ? I want to do it, one step at a time.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Are you just trying to move your old website to a new host? If so, it might be better to just wipe any new installation of WordPress on your new server, put in your old WordPress files, set up a new database and do an SQL import there.

    Also, if you forgot your WordPress password, here’s a way to get a new one by editing it in PHP MyAdmin :http://www.wpbeginner.com/beginners-guide/how-to-reset-a-wordpress-password-from-phpmyadmin/

    Thread Starter LightSquare

    (@lightsquare)

    That makes sense. I’ll try that. Thanks for your suggestions.
    I hope to slowly get nudged towards “Evrika!”
    I will place again the old WP folders exactly where they were relative to the root before, the domain name is the same, well, except this time it’s shared hosting. There is currently a fresh WP install there. I’ll remove it for the purposes of this try.
    ( Will all my previously installed plugins work, will they act as if they were installed from their wordpress.org library ? )

    (1)It used to be public_html/WP/
    wich to the public looks like
    (1b) http://www.philuxphoto.ca/WP/

    (2)New location will be public_html/philuxphoto.ca/WP/
    From the outside it will still look like
    (2b)www.philuxphoto.ca/WP/

    The root domain ( don’t know if that’s the proper name ) is http://www.vrcalgary.com

    I am worried about how the WP old install will understand the nested directory structure (2).

    Once my database is uploaded, with a clean user and pass, I guess I need to do some adjustments in php_config to point to it. DB location is not the same as it used to be ( external vs local hosted )

    Encrypting passwords, keys, very exciting. Sure learning new stuff.
    I’d rather populate and redesign my website, but will get to it.

    For the old WP install to understand the new directory structure, you will need to convert all instances of public_html/WP/ to public_html/philuxphoto.ca/WP/ in your database. You might want to just open the SQL file and do a find and replace. Make sure you also do a find and replace to replace the old URL to the new one.

    Plugins will still work, although I did encounter issues before where data from my widgets were not preserved. Reason for this is that the data is serialized, there’s a good explanation of it here.

    If you’re planning to port another site over, you might want to use this plugin for getting the SQL dump – makes it easy for you and you won’t lose any data too.

    Thread Starter LightSquare

    (@lightsquare)

    It was a bit like a monkey typing Shakespeare, but I did it !!!

    Situation:

    Initial setup: single domain, single hosting
    Wordpress installed under a “WP” folder to avoid clashes with previous webpage setup for my website.
    public_html/WP/ or http://www.philuxphoto.ca/WP/

    The destabilizing event was moving the domain http://www.philuxphoto.ca to new hosting. In particular shared hosting.

    From the FTP point of view things look now like this:
    (2) public_html/philuxphoto.ca/WP/ but from the outside it still looks http://www.philuxphoto.ca/WP/

    I backed up the old wordpress instalation folder and exported the database, from phpMyAdmin ( cPanel ) to my own computer.

    Of course when I tried to get it going again, on my new hosting, it wouldn’t work. I would get errors about the database, nothing will load after overwriting a fresh install of wordpress with my old wordpress.
    I wasn’t able to load my old database into the new PHPMyAdmin, I would get a 1044 error.

    First I’ve learned that I need to modify my database a bit:

    (1) I modified this in my original database ( using a text editor ): commented out two lines ( by placing two dashes in front of the commands — ) these lines should be at the beginning of your file, first 100 lines. Commenting out means that whoever uses the file will ignore that those lines:
    — CREATE DATABASE phi1519705110057 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
    — USE phi1519705110057;

    (2) To help myself I made a fresh install of WordPress, moved it to another folder “WP_Learning”.
    I stole everything I could from there: how to configure wp_config.php,

    (3) Under my MySQL Databases, rather than PHP MyAdmin, I created a new database, gave it a random name.

    (4) I imported the edited database to my new random name database.

    (5) eventually I renamed my new database in the form username_databasename
    Use the same format you see in the functional WP install, look inside phpMyAdmin for this.

    (6) This is what I did to the wp_config.php file ( based on (2) ) see below:
    There are notes within the code below:

    modified username_databasename, you will find it with (2)

    define('DB_NAME', 'username_databasename');

    This looks very much like the above, but it’s the username still
    you will find it with (2)

    /** MySQL database username */
    define('DB_USER', 'username');

    xxxxxxxxxx is some encrypted password
    you will find it with (2)

    /** MySQL database password */
    define('DB_PASSWORD', 'XXXXXXXXXXXX');

    Sometimes the database is hosted somewhere else and it looks like this phi1519705110057.db.5805708.hostedresource.com ( you should replace the localhost below with it )
    Again you will find what you need with (2)

    /** MySQL hostname */
    define('DB_HOST', 'localhost');

    Some notes follow inside the wp_config.php
    Then there is this:

    xxxxx and so forth, are keys that I copied from another existing wordpress database, a functional – legitimate one that was created just to learn, steal, from it everything I could
    Again you will find what you need with (2)

    define('AUTH_KEY',         'XXXXXXXXXXX');
    define('SECURE_AUTH_KEY',  'YYYYYYYYYYY');
    define('LOGGED_IN_KEY',    'ZZZZZZZZZZZ');
    define('NONCE_KEY',        'UUUUUUUUUUU');
    define('AUTH_SALT',        'PPPPPPPPPPP');
    define('SECURE_AUTH_SALT', 'VVVVVVVVVVV');
    define('LOGGED_IN_SALT',   'CCCCCCCCCCC');
    define('NONCE_SALT',       'NNNNNNNNNNN');

    TO Summarize:
    Old database needs to be loaded inside phpMyAdmin
    Get it’s name inside wp_config.php correctly.
    steal credentials from a legitimate working wordpress wp_config.php ( keys, users )

    You may need to do other stuff to get your old WP working again.
    In my case I was lucky enough that wordpress install didn’t really get confused by the nested structure, as I have now with shared hosting. Also, a bit of a nudge form the forums helps.

    Hope this useful to someone, take my advice with a grain of salt. I’ve never touched a MySql database until 2 days ago.

    Thread Starter LightSquare

    (@lightsquare)

    This is solved !

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘WP, Database Migration, Stuck’ is closed to new replies.