mirror of
https://github.com/YunoHost-Apps/glitchsoc_ynh.git
synced 2024-09-03 19:15:59 +02:00
[fix] Restore db with mastodon user
This commit is contained in:
parent
3a2f559174
commit
2f578fd2c2
1 changed files with 11 additions and 3 deletions
|
@ -70,9 +70,8 @@ sudo cp -a ./sources/. "$final_path"
|
||||||
|
|
||||||
# Set permissions
|
# Set permissions
|
||||||
sudo chown -R $app: "$final_path"
|
sudo chown -R $app: "$final_path"
|
||||||
sudo chmod -R a+rx /home/yunohost.backup/tmp
|
|
||||||
|
|
||||||
|
|
||||||
|
# Debug
|
||||||
sudo ls -alh "$final_path"
|
sudo ls -alh "$final_path"
|
||||||
|
|
||||||
# Change directory for create user & database postgresql
|
# Change directory for create user & database postgresql
|
||||||
|
@ -104,7 +103,16 @@ RAILS_ENV=production bin/bundle exec rails assets:precompile
|
||||||
RCOMMANDS
|
RCOMMANDS
|
||||||
|
|
||||||
# restore database
|
# restore database
|
||||||
sudo psql mastodon_production < $YNH_APP_BACKUP_DIR/mastodon_db.sql
|
sudo cp $YNH_APP_BACKUP_DIR/mastodon_db.sql $final_path
|
||||||
|
|
||||||
|
sudo su - $app <<RECOMMANDS
|
||||||
|
dropdb mastodon_production
|
||||||
|
createdb mastodon_production
|
||||||
|
psql mastodon_production < $YNH_APP_BACKUP_DIR/mastodon_db.sql
|
||||||
|
RECOMMANDS
|
||||||
|
|
||||||
|
# Remove dump
|
||||||
|
sudo rm $final_path/mastodon_db.sql
|
||||||
|
|
||||||
# Create symlink for ruby
|
# Create symlink for ruby
|
||||||
sudo ln -s /opt/mastodon/.rbenv/versions/2.4.1/bin/ruby /usr/bin/ruby || true
|
sudo ln -s /opt/mastodon/.rbenv/versions/2.4.1/bin/ruby /usr/bin/ruby || true
|
||||||
|
|
Loading…
Reference in a new issue