Migration to another instance

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Migration to another instance

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?

Cheers

--
Mathias Radtke


---
http://uib.de/de/support-schulung/schulung/

---
uib gmbh
Bonifaziusplatz 1B
55118 Mainz

Tel. 06131 / 27561-16 <phone:061312756116>
Fax  06131 / 27561-22 <phone:061312756122>

E-Mail: [hidden email]
Internet: www.uib.de

Geschäftsführer: dr. detlef oertel & erol ueluekmen
Handelsregister: Amtsgericht Mainz HRB 6942

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Migration to another instance

Adrian Schröter
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

Don't forget to rsync the later using

  rsync -avH ...

to not loose the hardlink information or you will need much more
space ....

--

Adrian Schroeter
email: [hidden email]

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
 
Maxfeldstraße 5                        
90409 Nürnberg
Germany


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Migration to another instance

Mathias Radtke
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?

Cheers

--
Mathias Radtke


---
http://uib.de/de/support-schulung/schulung/

---
uib gmbh
Bonifaziusplatz 1B
55118 Mainz

Tel. 06131 / 27561-16 <phone:061312756116>
Fax  06131 / 27561-22 <phone:061312756122>

E-Mail: [hidden email]
Internet: www.uib.de

Geschäftsführer: dr. detlef oertel & erol ueluekmen
Handelsregister: Amtsgericht Mainz HRB 6942

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Migration to another instance

Adrian Schröter
On Mittwoch, 30. August 2017, 08:13:57 CEST wrote Mathias Radtke:

> 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?

well, depends on you, but usually in your local MySQL database.

Have a look here for the configuration files:

 http://openbuildservice.org/help/manuals/obs-admin-guide/obs.cha.overview_filesystem.html

--

Adrian Schroeter
email: [hidden email]

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
 
Maxfeldstraße 5                        
90409 Nürnberg
Germany


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Migration to another instance

Stefan Seyfried
In reply to this post by Mathias Radtke
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 [hidden email] > 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: [hidden email]
To contact the owner, e-mail: [hidden email]