Support » Localhost Installs » Exporting database from test to production

  • papacico

    (@papacico)


    Hello everybody I am struggling every time I have to export a database from my local server on my PC (using xampp) to my production server (linux Centos7)

    the database from my local contains all referrers like http://localhost while in the production site they must be https://www.mysite.com
    I have tried 2 find and replace plugins but when the database is big they are crashing before the job is done.
    I would prefer to do all work on a shell environment using command line as it goes much quicker…
    I have also installed wp-cli and now I am testing with it but the find and replace command is not clear: wp search-replace “http://old-url.com”” “https://new-url.com””
    where and what database will be searched running this command which is give by wp instructions?

    What is the best way to solve this migration issue?
    Thank you

    • This topic was modified 1 month ago by papacico.
    • This topic was modified 1 month ago by papacico.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Yui

    (@fierevere)

    ゆい

    Migration plugins usually handle export and replacing domain in the database very well.

    i.e. Duplicator

    It is not recommended to do direct replace in the database dump or with SQL query,
    because some settings are stored in the serialized arrays and they will break.

    You can also use this 3rd party PHP script: https://github.com/interconnectit/Search-Replace-DB/releases

    Thread Starter papacico

    (@papacico)

    thank you will check the php script

    eagerbob

    (@eagerbob)

    I use the free WP-SYNC-DB plugin, which can do a find and replace so you can change your old URL into the new one. It can do big databases and the images too with an optional media-library extension. It can push (from local to remote) or pull (from remote) and it saves your settings so it becomes an easy process.

    https://wp-sync-db.github.io

    • This reply was modified 1 week ago by eagerbob.
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.