Help with migration Gogs

Dears, I have problems with the migration of gogs for another server.

I tried this.

####################################################################
option 1 (With user root)
####################################################################
./gogs backup -t "/tmp/git-teste/temporary" --target "/tmp/git-teste/temporary"
2020/02/12 13:39:26 [ WARN] Custom config '/opt/gogs/custom/conf/app.ini' not found, ignore this if you're running first time
2020/02/12 13:39:26 [ INFO] Backup root directory: /tmp/git-teste/temporary/gogs-backup-614113643
2020/02/12 13:39:26 [ INFO] Packing backup files to: /tmp/git-teste/temporary/gogs-backup-20200212133926.zip
2020/02/12 13:39:28 [TRACE] Cell2Int64 ([]uint8): [50]
2020/02/12 13:39:28 [ INFO] Dumping repositories in '/root/gogs-repositories'
2020/02/12 13:39:28 [FATAL] Fail to dump repositories: open /root/gogs-repositories: no such file or directory
####################################################################
Option 2 (User of app gogs (Name user: gogs) )
####################################################################
/gogs backup -t "/tmp/git-teste/temporary" --target "/tmp/git-teste/temporary"
2020/02/12 13:41:07 [ WARN] Custom config '/opt/gogs/custom/conf/app.ini' not found, ignore this if you're running first time
2020/02/12 13:41:07 [ INFO] Backup root directory: /tmp/git-teste/temporary/gogs-backup-903640127
2020/02/12 13:41:07 [ INFO] Packing backup files to: /tmp/git-teste/temporary/gogs-backup-20200212134107.zip
2020/02/12 13:41:09 [TRACE] Cell2Int64 ([]uint8): [50]
2020/02/12 13:41:09 [ INFO] Dumping repositories in '/home/gogs/gogs-repositories'
2020/02/12 13:41:09 [ INFO] Repositories dumped to: /tmp/git-teste/temporary/gogs-backup-903640127/repositories.zip
2020/02/12 13:41:09 [FATAL] Fail to save backup archive '/tmp/git-teste/temporary/gogs-backup-20200212134107.zip': open /tmp/cae/gogs-backup-20200212134107.zip/gogs-backup/metadata.ini: no such file or directory
####################################################################

Well, How can I Backup of repository and all data of gogs.

I tried too copy all paste of gogs, but doesn’t work.
How can I set directory with gogs script for backup of repositories?

Any suggestion?

My solution:

su gogs

run this script: "gogs-backup-script.sh "

Code of script “gogs-backup-script.sh”

**#!/bin/bash**

**mkdir -p /var/lib/git/temporary/cae**
**chown gogs:gogs /var/lib/git/temporary/cae -R**

**export APP_DIR=/opt/gogs**
**export USER=gogs**
**export HOME=/var/lib/git/gogs**
**export GOGS_CUSTOM=/etc/gogs**

**cd $APP_DIR**
**/opt/gogs/gogs backup -v --tempdir "/var/lib/git/temporary/cae" --target "/var/lib/git/temporary/" --exclude-repos**