Restoring MySQL Databases from their backups
Project description
Resurrector
Resurrector helps you to restore your backed-up MySQL Databases to any specified instance.
Pip
You can install this package from pip by running the following command :
pip install resurrector
Pros
-
Restore multiple databases at once
-
No need o know CLI commands to treat backup files
-
No need to know an OS to handle this process
-
You can specify which databases should be restored and exclude dbs which are should not.
-
You can restore only missing databases in the instance (no need to treat the existing ones)
-
Automatic decompression
Good to know
Depending on your MySql instance settings (such as user permissions or global variable specifications) you may need
to deal with input parameters of the Ressurector (see below).
Parameters
Name | Description | Type | Default
--- | --- | --- | ---
source | Input Folder (.zip or just normal folder) | string | -
host | MySQL Instance Ip | string | localhost
user | MySQL Instance User | string | root
port | MySQL Instance Port | integer | 3306
skip_dbs | List of Databases to skip | array | None
skip_existing | Should it skip the existing Databases? | boolean | True
mysql_global_vars | Global variables which should be run before each restoration | string (if multiple then semicolon sepearated) | SET @@GLOBAL.GTID_PURGED='';
exclude_sql_parts | SQL contents which should be removed | string | SET GLOBAL max_allowed_packet=268435456;
charset | Database charset | string | utf8
collate | Database collation | string | utf8_general_ci
debug | Debug the process on console | boolean | False
How it works
Resurrector reads a folder (either as zipped or not) and searches for .gz files in it, these must contain .sql files which were
backed up in your servers either automatically or manually. After connecting to the given database instance it creates these databases by
and "fills" them one by one (executes the whole .sql file (query) on each respective database).
Simple usage
import resurrector
resurrector.resurrect(source='files/2022-07-06',
host='localhost',
user='root',
password='',
port=3306, skip_existing=True, debug=True)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file resurrector-0.0.7.tar.gz
.
File metadata
- Download URL: resurrector-0.0.7.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/3.7.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b22a8296ee0a7b361709ca4fa9ef770c66f209b7b5b885dd87bf7e3dd4347c8 |
|
MD5 | 36049e99a0d8c3bb72f721f50d0aa36c |
|
BLAKE2b-256 | b6bb67e36923d9e73ad37087ac6c13f2004f1d32df391dd49f4e711929c6f188 |
File details
Details for the file resurrector-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: resurrector-0.0.7-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/3.7.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a5262a113ff02bb078975e564977899afeb4f4cebcd71d7e9d7f5f72a914c2e |
|
MD5 | d7f1326d346b81b74428360ba0a00b72 |
|
BLAKE2b-256 | 9eff57f7a7694b76673477ec008f637585fe2e5e61bdc51ff0cab7e346d479c6 |