Mailinglist Archive: opensuse-buildservice (123 mails)

< Previous Next >
Re: [opensuse-buildservice] Migration to another instance
On 30.08.2017 08:13, Mathias Radtke wrote:
Hi


On 30.08.2017 08:01, Adrian Schröter wrote:
On Mittwoch, 30. August 2017, 07:26:18 CEST wrote Mathias Radtke:
Hi,

since our local OBS instance had numerous filesystem errors the UI
changes aren't written to the backend anymore.
I would like to migrate the backend to another OBS instance.

How can this be achieved?
Copy your configuration, the database and the backend content below /srv/obs
Where is the configuration and the database stored?

These are the notes I took while moving my 2.7 (SLES11) installation to a new
2.8 (SLES12) box:

old machine (/srv/obs is on a NFS share)

---------
# stop and disable all obs services
# create a snapshot of the /srv/obs volume on the NFS filer, just to be sure ;-)

cd /srv/obs
mysqldump -u root -p --opt --all-databases -r backup.sql
gpg --export --armor obsrun@xxxxxxxxxxxxxxxxxx > pubkey.asc
---------
copy the following files from old to new machine:
/usr/lib/obs/server/BSConfig.pm
/etc/obskeyfile.asc # $keyfile = $gpg_standard_key =
"/etc/obskeyfile.asc";
/etc/obs_publish_hook.sh # custom publish hook
/etc/sign.conf
/root/.phrases/
/root/.gnupg/secring.gpg
/root/.my.cnf
/etc/ssl/obs/ # my SSL certificates are here
/srv/www/obs/api/config/options.yml
/srv/www/obs/api/config/database.yml

new machine:
-------------------------------------------------------------------------
mount /srv/obs
zypper in obs-api obs-server apache2 apache2-mox_xforward
rubygem-passenger-apache2 obs-source_service
zypper in obs-service-download_files obs-service-download_src_package
obs-service-download_url \
obs-service-extract_file obs-service-format_spec_file
obs-service-git_tarballs \
obs-service-github_tarballs obs-service-recompress
obs-service-refresh_patches \
obs-service-set_version obs-service-source_validator
obs-service-tar_scm obs-service-verify_file \
obs-service-obs_scm obs-service-tar obs-service-update_source

# make sure that obsrun and obsapidelayed UIDs and obsrun GID are identical to
old system
vi /etc/passwd /etc/group

MODULES="passenger rewrite proxy proxy_http xforward headers socache_shmcb"
for i in $MODULES; do a2enmod $i; done
a2enflag SSL

rcmysql start
mysql_secure_installation # set root password as in /root/.my.cnf
systemctl enable mysql.service
mysql -u root < /srv/obs/backup.sql
gpg --import < /srv/obs/pubkey.asc

cd /srv/www/obs/api/
RAILS_ENV="production" rails.ruby2.4 db:migrate ## errors Mysql2::Error: Can't
DROP ... -- comment the failing lines

# edit /etc/apache2/vhosts.d/obs.conf for SSLCertificateFile and
SSLCertificateKeyFile
# edit /etc/apache2/conf.d/mod_passenger.conf for 'PassengerRuby
"/usr/bin/ruby.ruby2.4"'

# then enable and start all obs services
# check your BSConfig.pm for changed IP addresses etc.
-------------------------------------------------------------------------

That's mostly it, I additionally added systemd drop-in files to fix wrong /
missing dependencies in OBS init scripts so
that the machine was reboot safe (sometimes warden was started before /srv/obs
was mounted, or on shutdown mysql was
stopped before obsapidelayed was shut down, but that's easily fixable with
systemd drop-in service files, and only a
reliability fix).

Missing the GPG keys when migrating to a new machine will get funny probably
only some time later, when a project key
expires... ;-)
--
Stefan Seyfried

"For a successful technology, reality must take precedence over
public relations, for nature cannot be fooled." -- Richard Feynman
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages