Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A PHP search replace tool for quickly modifying a string throughout a database. Useful for changing the base URL when migrating a WordPress site from development to production.

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md

Search Replace DB

This script was made to aid the process of migrating PHP and MySQL based websites. It has additional features for WordPress but works for most other similar CMSes.

If you find a problem let us know in the issues area and if you can improve the code then please fork the repository and send us a pull request :)

Usage

  • Migrate all your website files
  • Upload the script to your web root (or the same folder as wp-config.php)
  • Browse to the script's URL in your web browser
  • Follow the on-screen instructions

CLI script

  1. Run the CLI script from the command line like so: ./searchreplacedb2cli.php --host localhost --user root --database test --pass "pass" --charset utf\-8 --search "findMe" --replace "replaceMe"
  2. use the --dry-run flag to do a dry run without searching/replacing

You can use short form arguments too so --host becomes -h and so on.

Note

If you use some dynamic processing to setup the database definitions in WordPress try using the 'filestream' branch. Let us know if you find any bugs or have any suggestions to improve it.

Something went wrong with that request. Please try again.