pjanser / craft-db-extract
A small helper Plugin for CraftCMS to download the DB over HTTP requiring authorization.
Installs: 127
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 4
Type:craft-plugin
Requires
- craftcms/cms: ^3.6.0
Requires (Dev)
- vlucas/phpdotenv: >=5
This package is auto-updated.
Last update: 2023-10-01 00:17:10 UTC
README
A small helper Plugin for CraftCMS to download the DB over HTTP requiring authorization.
Requirements
This plugin requires Craft CMS 3.0.0-beta.23 or later.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require pjanser/craft-db-extract
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for craft-db-extract.
craft-db-extract Overview
This plugin makes a web controller action available to pull the database export.
Using craft-db-extract
The controller action requires an admin login. Provide your credentials in the Authoirization header with basic authentication.
HTTP Header:
Authorization: Basic xxxxxxxxxxxx
Tip: If you experience 401 Unauthorized eventhough you provide correct admin credentials, you can try to add the following line to your .htaccess
:
SetEnvIf Authorization (.+) HTTP_AUTHORIZATION=$0
Pulling the database in *.sql format:
GET YOUR_WEBSITE/actions/craft-db-extract/db-export
Pulling the database in *.sql.gz format:
GET YOUR_WEBSITE/actions/craft-db-extract/db-export?compression=gzip
craft-db-extract Roadmap
Some things to do, and ideas for potential features:
- Authorization with user token
- Add different compressions
- Configurable filename for response
Brought to you by P. Janser