Coder Social home page Coder Social logo

Comments (2)

vallon avatar vallon commented on June 6, 2024

Reproduced with latest gogs:

Build docker:

git clone https://github.com/gogs/gogs
cd gogs
docker build --tag gogs7684:latest .

Startup gogs on data0:

docker run --rm \
    --volume $PWD/data0:/data \
    --volume $PWD/backup0:/backup \
    --env RUN_CROND=true \
    --env BACKUP_INTERVAL=1h \
    gogs7684

Configure:

  • Database type = SQLite3
  • Application URL = $EXTERNALURL
  • Admin Username = gogs
  • Admin Password = gogs
  • Install
  • Create a repo for reference: "myrepo", Init this repo

Wait for backup at :00, or adjust cron crontab -u git -e. Backup in backup0/gogs-backup-*.zip. Kill container.

Run new container, restore:

docker run \
    --rm \
    --volume $PWD/data1:/data \
    --volume $PWD/backup0:/restore \
    gogs7684 sh -c '
        source /app/gogs/docker/s6/gogs/setup # symlinks
        gosu $USER mkdir /data/tmp  # mv across filesystems
        gosu $USER /app/gogs/gogs restore --from /restore/gogs-backup-*.zip --tempdir /data/tmp
        find /data/gogs /data/gogs.bak
    '

This shows:

/data/gogs
/data/gogs/conf
/data/gogs/conf/app.ini
/data/gogs/log
/data/gogs/log/gogs.log
/data/gogs/log/xorm.log
/data/gogs/log/gorm.log
/data/gogs.bak
/data/gogs.bak/data
/data/gogs.bak/data/gogs.db
/data/gogs.bak/conf
/data/gogs.bak/log
/data/gogs.bak/log/xorm.log
/data/gogs.bak/log/gorm.log

The database was moved to /data/gogs.bak/data/gogs.db.

from gogs.

vallon avatar vallon commented on June 6, 2024

The "gogs backup" explicitly excluded the data directory from the backup. It seems the simplest fix would be that after the restore of $GOGS_CUSTOM, if $GOGS_CUSTOM.bak/data exists, then move it back to $GOGS_CUSTOM.

from gogs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.