This release contains a couple of new hypernode-importer features that have been used by our onboarding team for a while already and today they have been added to the help menu so they can be used by all Hypernode users.
- Importing the webroot from the filesystem instead of the remote host
This flag enables you to specify a directory or an archive on the Hypernode to import the shop from. This can be useful when you only have access to a (compressed) backup of a shop.
--import-from-local-filesystem path
Specify an archive to get the webroot from instead of
syncing the files from the remote host. Allowed
formats: .rar, .tar, .tar.gz, .tar.bz2
- Import the database from a SQL dump
Sometimes you might want to import the database for a shop from a dump instead of using the MySQL login information found in app/etc/local.xml
to get the database from the remote host. With this flag you have the option to specify either a .sql file or a gzipped .sql.gz file to import the database from instead of from the remote host.
--use-sql-for-db path
Import the database from a sql dump instead of syncing
it from the remote host. Allowed formats: .sql,
.sql.gz
If both --import-from-local-filesystem
and --use-sql-for-db
are provided a shop can be completely imported from a backup and no connection has to be made to a remote host.
Example:
$ hypernode-importer --import-from-local-filesystem backup.zip --use-sql-for-db magento.sql --verbose --set-default-url
- Exclude specific files from the data sync
In some cases you need to import a remote shop once, change some files on the Hypernode you imported the shop to and then run the import again to synchronize the latest changes. To prevent your manual changes to be overwritten by the second import the path to a file containing rsync protect filter rules can be passed.
For more information see the Filter Rules section in the rsync man page:
FILTER RULES
protect, P specifies a pattern for protecting files from deletion.
--protected-file path
An optional file to pass as a 'protect' filter to
rsync to exclude files during the sync
- Specify a settings file with arguments for the importer
The hypernode-importer now supports a settings file in JSON format that can be used to specify options. If you are scripting around the importer and you do not want to deal with escaping parameters this option provides a safe and easy way to programmatically tell the importer where to get the shop from.
--use-settings-file USE_SETTINGS_FILE
Parse a json file for keys and values that will be
used as arguments for the importer. Can be handy for
scripting purposes. Example content: {"path":
"/data/web/public"}
An example settings file might look like:
{"path": "/data/web/public", "host": "example.com", "user": "app", "port": 22}
And can then be used to import a shop like:
hypernode-importer --safe-mode --use-settings-file /data/web/settings_file.json
- Automatically find the remote webroot if no
--path
is provided
If no --path
is provided the hypernode-importer will look in sequentially $HOME, /var/www, /var/html and /www for a Magento installation and use the first found installation if there is one. If the path is provided only that path will be searched in, which is the same behavior as before except for that sub-directories will also be searched in if the path provided is not the webroot itself.
$ hypernode-importer --host vdloo.hypernode.io
Connecting to app@vdloo.hypernode.io without password
Looking for Magento installation in $HOME
Verifying remote Magento installation..
(remote) find $HOME -name local.xml | grep 'app/etc/local.xml' | sed 's/app/etc/local.xml//g' | head -n 1
Couldn't find Magento installation in $HOME
Looking for Magento installation in None
Verifying remote Magento installation..
(remote) find /var/www -name local.xml | grep 'app/etc/local.xml' | sed 's/app/etc/local.xml//g' | head -n 1
Found Magento installation in /var/www/magento/!