WordPress.org

Support

Support » Localhost Installs » [Resolved] importing existing database to xamp localhost

[Resolved] importing existing database to xamp localhost

  • Hi, I have exported a database from cPanel. Both .sql and .zip are now sitting on my desktop.
    Using phpMyAdmin I have imported the .sql file.
    I have gone into “options” and change both “home” and “siteurl” to http://localhost/mysite
    I have created a new wp “mysite” which I can access.

    I have changed wp-config.php
    // ** MySQL settings – You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define(‘DB_NAME’, ‘mysitedb’);

    /** MySQL database username */
    define(‘DB_USER’, ‘root’);

    /** MySQL database password */
    define(‘DB_PASSWORD’, ”);

    /** MySQL hostname */
    define(‘DB_HOST’, ‘localhost’);

    Where am I to upzip and save all files too?
    How do I import these files into wordpress “mysite”.

    This is totally new to me. I have spent the day reading various forums and am totally lost. I have not idea whether I have gone about this the right way.

Viewing 5 replies - 1 through 5 (of 5 total)
  • on my wamp server i pasted all word press files to the wamp/www folder. i would say its probably the same for xamp.
    wait, what files are you talking about?

    Anything you want to work on needs to be in the /xampp/htdocs/ folder. Presuming the .zip file you mention is the WP source code, it needs to be extracted into /xampp/htdocs/mysitename/wordpress/ or something similar.

    Thanks for your response.

    My database “.sql” import files (frm MYD MYI)are sitting in:
    C:\xampp\mysql\data\mysitedb

    The “.zip” files (php + folders) have been extracted to:
    C:\xampp\htdocs\mysitedb

    Is there anything further I am meant to do.

    I have also created a new WP called “mysite”.

    How do I get everything to marry?

    Having a good understanding of Installing WordPress might be of help, specifically How To Install on Your Own Computer.

    Here’s the process in a nutshell (assuming your .sql file contains both structure and data) Some of this sounds like you may have done already:

    1. In PHPmyAdmin, create your database.
    2. In your favorite text editor (I like Notepad++) open the .sql file and press ctrl-H to open the Replace dialogue. (make a backup of your .sql file before this, just in case)
    2a. In ‘Find what:’ type the old url, eg. mysite.com
    2b. In ‘Replace with:’ type localhost (or in your case localhost/mysitedb)
    2c. Click ‘Replace All’, and then ctrl-S to save the edited file.
    3. Import your edited .sql file to the database you created in PHPmyAdmin. (it doesn’t matter where you store your .sql file, once it’s imported xampp will have it where it likes it)
    4. Extract your zip to somewhere within /xampp/htdocs (which you have done)
    5. With your text editor edit the config.php in your WP files to match the new database name, username, and password (xampp default for the last two are ‘root’ with no password (blank)). Ctrl-S to save this.

    Now you can point your browser to http://localhost/mysitedb and it should just work. Hope I didn’t leave anything out!

    Here’s a video that explains it pretty clearly:
    part 1
    part 2

    Hi CiderJack,

    Cleaned everything out and started afresh. All working perfectly now.
    Sincerest thanks for your help.
    Have always worked in print, should be great learning electronic.

    Thanks once again.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] importing existing database to xamp localhost’ is closed to new replies.
Skip to toolbar