Support » Fixing WordPress » Switching sql files between local and online hosts

  • Hi fellow WordPress experts.

    I’m building online and locally (MAMP) hosted websites using a Mac. Ideally I’d like to be able to develop offline, then upload to the online host, or a further development area of my main site.

    This is the method I’ve been using to get a website online.

    The local sql files where saved using these details:

    Export: SQL
    Options: Structure
    Add AUTO_INCREMENT value
    Enclose table and field names with backquotes
    Save as file: Compression: None

    I then searched and changed all localhost references in the sql file to the online address.

    I then changed the upload path below to the correct hosted address
    INSERT INTO wp_options VALUES(59, 0, ‘upload_path’, ‘/_THE UPLOAD PATH_/wp-content/uploads’, ‘yes’);

    Next I imported the sql file to the hosted database.

    Finally I manually uploaded the pictures into the online upload folder to relink them.

    It seems to work. But my simple questions are:
    1. Does this seem correct?
    2. If it is, there a easier way of doing it?

    Thanks for your time!

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi


    Forum Moderator

    It seems a heck of a lot of work to me. And there are lots of points where it could all go horribly wrong. Why do you need to move the sql data back & forth? Both theme and plugin development can be carried out offline and the only things that need uploading to the live site are the complete & tested theme and/or plugins. Data can be exported/imported using the built-in tools. The basic configuration for a brand new site can be carried out in about 30 mins flat. So why bother with sql dumps?

    Thanks for the reply.

    I’m a designer rather than a developer, so excuse my ignorance with some technical aspects of WordPress.

    If I develop a site locally and put any content (pics or text) into that site, then I’d presumed that the data from my local database will need to imported into my online database. Otherwise I’ll have the proper design online, but an empty database.

    When you say data can be imported and exported using the built in tools, do you mean with a plugin, or via something in the dashboard that I’m not familiar with?



    Forum Moderator

    Via the Dashboard. Look under Tools.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Switching sql files between local and online hosts’ is closed to new replies.