https://github.com/ruhanirabin/wp_changedomain_sh
WordPress Change Domain inside DB using Shell / String Replace in All Occurrences
https://github.com/ruhanirabin/wp_changedomain_sh
database find-and-replace mysql shell-script wordpress wordpress-site
Last synced: 28 days ago
JSON representation
WordPress Change Domain inside DB using Shell / String Replace in All Occurrences
- Host: GitHub
- URL: https://github.com/ruhanirabin/wp_changedomain_sh
- Owner: ruhanirabin
- License: apache-2.0
- Created: 2018-04-08T10:10:03.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-05-31T06:51:41.000Z (about 2 years ago)
- Last Synced: 2024-05-31T07:58:24.318Z (about 2 years ago)
- Topics: database, find-and-replace, mysql, shell-script, wordpress, wordpress-site
- Language: Shell
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wp_changedomain.sh
WordPress Change Domain inside DB using Shell / String Replace in All Occurrences
A simple Shell Script to Change all WordPress domain name OR String instances
After the Find and Replace operation, it will be re-imported back to DB
## Pre-requisities
1. You will need shell access to your server
2. Only works for linux based servers
## Can be used for
1. Domain Migration
2. Update Existing Domain to HTTPS
3. Find and Replace a string in the whole database
It keeps an archive file just in case
## What does it do actually?
1. It uses `mysqldump` command to export the database specified in the variables
2. Creates a `tar.gz` archive for the named `exported SQL` file
3. Then it performs a linux `SED` find and replace operation inside the SQL file
4. Then, it uses `mysqldump` to re-import the SQL file back into the database
### Basic Usage in bash console as:
```
sh wp_changedomain.sh
```
#### from: www.RuhaniRabin.com