WordPress.org

Ready to get started?Download WordPress

Forums

Switching sql files between local and online hosts (4 posts)

  1. Rusty2
    Member
    Posted 4 years ago #

    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 DROP TABLE / VIEW / PROCEDURE / FUNCTION
    Add AUTO_INCREMENT value
    Enclose table and field names with backquotes
    Data
    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!

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    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?

  3. Rusty2
    Member
    Posted 4 years ago #

    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?

  4. esmi
    Forum Moderator
    Posted 4 years ago #

    Via the Dashboard. Look under Tools.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags