Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Wordpress database fun

Options
  • 06-11-2010 10:00pm
    #1
    Registered Users Posts: 12,746 ✭✭✭✭


    A little bit of knowledge can be a dangerous thing. I had enough knowledge to setup a wordpress site for college, but when the time came to take it apart I messed up.
    So if anyone could help with the current situation I'll be extremely grateful.

    I no longer have access to the original Wordpress site, but I do have the entire contents of the site saved on my computer, including a backup of the original db.

    I want to setup the site on my computer, I'm currently trying to do this with MAMP.

    At present I can setup a new wordpress install and operate it with MAMP, but I don't know how to import my old database.
    I've tried just deleting the files from the new database and replacing them with the old, but that just directs everything to the old web address.

    So, can somebody tell me what files I have to edit in the old database or wordpress install to make it operate on my localhost?
    I gather I need to change the wp-config, but there's obviously something in one of the database tables that's screwing things up too.


Comments

  • Registered Users Posts: 16,413 ✭✭✭✭Trojan


    You need to ensure that the database host, database name and prefix in the wp-config file match up to whereever you have it installed locally.

    1) DB host will be 127.0.0.1 or "localhost" unless you're doing something weird,
    2) prefix will be "wp_" unless it was changed,
    3) you should know the database name.


  • Registered Users Posts: 12,746 ✭✭✭✭FewFew


    Trojan wrote: »
    You need to ensure that the database host, database name and prefix in the wp-config file match up to whereever you have it installed locally.

    1) DB host will be 127.0.0.1 or "localhost" unless you're doing something weird,
    2) prefix will be "wp_" unless it was changed,
    3) you should know the database name.

    Yeah, see I setup my local site, whose database had the prefix wp_ as standard, then I imported my old database, whose prefix was wp3_ . So when I imported the wp3 database I was left with wp_ and wp3_ sitting side by side. I then went through the wp_ tables, deleting them and then renaming the wp3_ equivalent as wp_ .

    The local website looked like it was working alright, until I realised it was linking to the current online version of the site rather than the offline version of the old site.

    There's some link I don't know about that I need to change I fear.


  • Registered Users Posts: 342 ✭✭adm


    A slightly irritating thing about wordpress is that it stores some path information in the database.
    Run this query on the db.
    SELECT *
    FROM `wp_options`
    WHERE `option_name` IN ('siteurl','home','upload_path');
    

    You need to change the value of those to reflect your local path.


  • Registered Users Posts: 12,746 ✭✭✭✭FewFew


    Ah! I knew there'd be a cheeky bugger like that lurking somewhere! Thank you so much, if this works you've not only saved my ass but also the work of my entire class! :)


Advertisement