Insert payloads (fylr restore)
This page describes the process of inserting a local backup of JSON payloads to a target fylr instance
The fylr restore
command performs POST
requests to the API of the target fylr instance. It iterates over the list of payloads from the manifest.json
file.
A basic restore command looks like this:
--server
,--login
and--password
refer to the target serverfor the
--server
parameter, include the HTTP Basic Auth:http://<login>:<password>@<fylr url>/api/v1
--chunk
defines the batch size of objects in POST requests toapi/v1/db
if the objects are too big or complex, the requests might take too long and cause a timeout
in this case, lower this value and continue restoring with
--continue
Parameters
This is a complete overview of the command line parameters (run fylr restore -h
):
--manifest
--manifest
Manifest file that has been created by the backup
command.
this parameter is mandatory!
type:
string
--server
--server
API Url of the target instance. The Url must include the API base endpoint, for fylr this is <target url>/api/v1
.
this parameter is mandatory!
type:
string
--login
--login
Username of the user in the target instance. It should be a user with root rights or sufficient read rights.
this parameter is mandatory!
type:
string
--password
--password
Password of the user in the target instance.
this parameter is mandatory!
type:
string
--purge
--purge
Defines the mode of the restoring (purge or continue).
If this is true
, the complete restore starts from the beginning, and the target instance is purged.
The parameters --purge
and --continue
are mutually exclusive. Not both can be true
.
type:
bool
default:
false
--continue
--continue
Defines the mode of the restoring (purge or continue).
If this is true
, the restore continues from the last point in the progress.json
file, if a previous restore run was interrupted.
The parameters --purge
and --continue
are mutually exclusive.
type:
bool
default:
false
--base-config
--base-config
Path to a specific base config file. Defaults to <instance folder>/base_config.json
from the backup.
To not upload a base configuration to the target instance, specify --base-config=-
This parameter is not allowed in combination with --continue
.
type:
string
default:
base_config.json
--datamodel
--datamodel
Path to a specific datamodel file. Defaults to <instance folder>/datamodel.json
from the backup.
To not upload a datamodel to the target instance, specify --datamodel=-
This parameter is not allowed in combination with --continue
.
Trying to upload a datamodel without --purge
will not work, if there is already a datamodel on the target instance!
Only use --datamodel=-
if the target instance already has a matching datamodel!
type:
string
default:
datamodel.json
--skip-constraints
--skip-constraints
Skip constraints during restore.
type:
bool
default:
false
--include-password
--include-password
Include user password hashes. If this option is true
, the restore tool checks if there is at least one user where a password hash is present. This is done by checking the has_passwords
flag in the manifest.json
. If this value is false
, the restore will stop with an error.
If the source is an easydb5: make sure that the source instance is configured to output the user passwords, and repeat the backup. See https://docs.easydb.de/en/sysadmin/configuration/easydb-server.yml/available-variables/ under include_passwords
for the necessary settings in the source instance.
For a fylr source instance this is not necessary, since the password hashes are always returned over the API.
type:
bool
default:
false
--include-events
--include-events
Comma separated list of event types.
Use --include-events=-
to skip restoring of events.
If this parameter is unset, all events are restored which have a type that is known in fylr. All other events from the backup are ignored.
type:
string
default:
""
--chunk
--chunk
The upload batch size for objects to the target instance. Can be used to control the size of the requests. It can be lowered if the requests cause timeouts or network problems.
type:
int
minimum:
1
maximum:
1000
default:
100
--limit
--limit
Set this to a number bigger than 0
to limit the number of objects of each objecttype. This can be used to test or debug to only restore a small sample of the source instance.
type:
int
minimum:
0
default:
0
--file-api
--file-api
Method used to upload files. Leave empty to not upload files.
put
: restore tool uploads files synchronous.rput
: target server loads files from remote URLs.rput_leave
: target server stores remote URLs, no data is copied to storage.
rput
and rput_leave
are faster, put
might take long.
type:
string
--file-api-access-token
--file-api-access-token
Use this to pass an access token to fylr backends. This is needed to load files from fylr source instances. It appends the access_token
query parameter to the remote url of files, and removes the x-fylr-signature
query parameter.
type:
string
--file-version
--file-version
Specify which version of the source asset is used. Default is "original"
which might take long for --file-api=put
.
Use "preview"
for test runs with smaller assets.
type:
string
default:
"original"
--upload-versions
--upload-versions
Set to true
, to not produce local preview versions, but instead upload/link the source versions.
The upload method --file-api
is used for versions the same way as for the original file.
If
put
orrput
is used, the versions are copied from the source instance, but no versions are producedIf
rput_leave
is used, the versions are linked by URL, and no files are copied to the target instance and no versions are produced
type:
bool
default:
false
--rename-versions
--rename-versions
Rename versions before uploading. This affects uploaded rights as well as file versions.
The versions need to be given in the notation "<cls>.<version>:<new version>"
, e.g. "image.preview:640px"
would replace the "preview"
version of class image
to 640px
.
If the <new version>
part is omitted, the version is removed.
type:
string
--max-parallel-upload-files
--max-parallel-upload-files
Maximum number of parallel uploads of original files and their versions. Defaults to 4
(0
for bulk). The maximum is 10
(unlimited for bulk).
type:
int
minimum:
0
maximum:
10
default:
4
--timeout-min
--timeout-min
Timeout for connections to target in minutes.
Increase this value if you notice timeouts or related network problems when uploading payloads or files to the target system.
type:
int
minimum:
1
default:
10
--upload-ignore-files-with-errors
--upload-ignore-files-with-errors
Set to true
to ignore file upload errors and strip objects from them.
type:
bool
default:
false
--client-id
--client-id
If the target instance uses OAuth2 for user authentication, this is the configured Client ID.
type:
string
--client-secret
--client-secret
If the target instance uses OAuth2 for user authentication, this is the configured Client Secret. Can be kept empty if the instance is public.
type:
string
--client-token-url
--client-token-url
If the target instance uses OAuth2 for user authentication, this is the OAuth2 callback endpoint of the instance.
For fylr this is <source url>/api/oauth2/token
.
type:
string
--insecure
--insecure
This parameter is available in fylr from version v6.14.0.
Set to true
to skip the certificate check for the connection to the target instance.
Only use this option if you can trust the remote server!
type:
bool
default:
false
--verbose
--verbose
Set to true
to log debugging info.
type:
bool
default:
false
--log-network
--log-network
Set to true
to log the requests and responses.
type:
bool
default:
false
--log
--log
If this is a valid file path, the log output is written to this file. If this is empty (default), the log output is written to stdout
instead.
type:
string
Last updated