All Projects → Automattic → Go Search Replace

Automattic / Go Search Replace

Licence: gpl-3.0
🚀 Search & replace URLs in WordPress SQL files.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Go Search Replace

Pyparsing
Python library for creating PEG parsers
Stars: ✭ 1,052 (+1745.61%)
Mutual labels:  text-processing
Phpwpinfo
Provides an equivalent to the `phpinfo()` but with more WordPress requirements details.
Stars: ✭ 52 (-8.77%)
Mutual labels:  wordpress
Lightning
Lightning is powerful them for WordPress.
Stars: ✭ 55 (-3.51%)
Mutual labels:  wordpress
Shapely
Free multipurpose WordPress theme built using Bootstrap
Stars: ✭ 50 (-12.28%)
Mutual labels:  wordpress
Wordpress Cloud Media Offloader Plugin
A simple plugin that allows you to serve your WordPress Media Library files from the Backblaze B2 cloud storage service.
Stars: ✭ 52 (-8.77%)
Mutual labels:  wordpress
Caddy Script
🐳 Caddy installation script
Stars: ✭ 53 (-7.02%)
Mutual labels:  wordpress
Wordpress Pubsubhubbub
WebSub/PubSubHubbub for WordPress
Stars: ✭ 49 (-14.04%)
Mutual labels:  wordpress
Wordpress Zero Spam
The WordPress Zero Spam plugin makes blocking spam a cinch without all the bloated options. Just install, activate, and say goodbye to spam.
Stars: ✭ 56 (-1.75%)
Mutual labels:  wordpress
Keyring
Keyring is an authentication framework for WordPress. It comes with definitions for a variety of HTTP Basic, OAuth1 and OAuth2 web services. Use it as a common foundation for working with other web services from within WordPress code.
Stars: ✭ 52 (-8.77%)
Mutual labels:  wordpress
Generator Dhboilerplate
Boilerplate made by David Hellmann
Stars: ✭ 54 (-5.26%)
Mutual labels:  wordpress
Wp Functions
A compilation of function snippets for WordPress developers who create their own themes.
Stars: ✭ 1,055 (+1750.88%)
Mutual labels:  wordpress
Images Via Imgix
imgix WordPress plugin
Stars: ✭ 51 (-10.53%)
Mutual labels:  wordpress
Gravityblocks
Gravity Forms blocks for Gutenberg, the new WordPress editor
Stars: ✭ 54 (-5.26%)
Mutual labels:  wordpress
Generator Baukasten
Awesome!
Stars: ✭ 50 (-12.28%)
Mutual labels:  wordpress
Smart Media
Smart Media enhancements for WordPress
Stars: ✭ 56 (-1.75%)
Mutual labels:  wordpress
Wordpress Lightning Publisher
⚡️ Lightning Publisher for WordPress
Stars: ✭ 50 (-12.28%)
Mutual labels:  wordpress
Framework
Assely is a PHP framework which brings a little joy to the WordPress development. Develop structured, easily scalable and complex WordPress websites and web applications with true pleasure.
Stars: ✭ 53 (-7.02%)
Mutual labels:  wordpress
Pipeit
PipeIt is a text transformation, conversion, cleansing and extraction tool.
Stars: ✭ 57 (+0%)
Mutual labels:  text-processing
Better Rest Endpoints
A WordPress plugin that serves up slimmer WP Rest API endpoints.
Stars: ✭ 56 (-1.75%)
Mutual labels:  wordpress
Wl Bootstrap
Integrating Laravel into WordPress
Stars: ✭ 54 (-5.26%)
Mutual labels:  wordpress

Go Search Replace

Build Status

Search & replace URLs in WordPress SQL files.

cat example-from.com.sql | search-replace example-from.com example-to.com > example-to.com.sql

Overview

Migrating WordPress databases often requires replacing domain names. This is a complex operation because WordPress stores PHP serialized data, which encodes string lengths. The common method uses PHP to unserialize the data, do the search/replace, and then re-serialize the data before writing it back to the database. Here we replace strings in the SQL file and then fix the string lengths.

Considerations

Replacing strings in a SQL file can be dangerous. We have to be careful not to modify the structure of the file in a way that would corrupt the file. For this reason, we're limiting the search domain to roughly include characters that can be used in domain names. Since the most common usage for search-replace is changing domain names or switching http: to https:, this is an easy way to avoid otherwise complex issues.

Installation

This package requires Go. An easy way to install Go on a Mac is with Homebrew.

Note the changes you need to make to your PATH and that you have to either restart your terminal or source your shell rc file.

You need to install Gox which you can install with go get github.com/mitchellh/gox

Once that's installed you can install this tool with the following command: go get github.com/Automattic/go-search-replace

Go is set up by convention, not configuration so your files likely live in a directory like: /Users/user/go/src/github.com/Automattic/go-search-replace

Nagivage to that directory and run make

go-search-replace will be ready for you to use. Once built you won't have to complete any of the above steps again.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].