It's quite easy to migrate spacewalk to run off a external db-instance.
Here I will show how to migrate the embedded db to an external server.
The requirements:
Let's get started
First we need to stop all Spacewalk-services. Do that by running the following command:
Run the following on the db-server.
Switch over to the Spacewalk-server and run the setup again to setup the db and give it the external db.
If the installer is finished. import the sql-dump into the spacewalk-database. Run
You can now start the spacewalk-services again by issuing
Feel free to comment and / or suggest a topic.
Here I will show how to migrate the embedded db to an external server.
The requirements:
- spacewalk-utils and spacewalk-dobby must be installed on the spacewalk-server
- an external postgresql-server allowing connections from the spacewalk using your user and db
- Same version of the database on both servers (9.2)
Let's get started
First we need to stop all Spacewalk-services. Do that by running the following command:
and start the db-service from spacewalk
sudo spacewalk-service stop
[archy@spacewalk ~]$
Next we will make a backup of our currently running database. My recommendation is also to back it up and store it on a nother server regularly.
sudo db-control start
[archy@spacewalk ~]$
Now we can stop the internal database
spacewalk-dump-schema --to=postgresql > spacewalk_migration_backup.sql
[archy@spacewalk ~]$ sudo
Now we will have to switch over to the pgsql-server and modify the database a bit.
db-control stop
[archy@spacewalk ~]$ sudo
Run the following on the db-server.
The database is setup now.
sudo su - postgres
[archy@pgsql01 ~]$
psql CREATE USER rhnuser WITH PASSWORD 'my_secret_password'; ALTER USER rhnuser WITH SUPERUSER; CREATE DATABASE rhnschema; GRANT ALL PRIVILEGES ON DATABASE rhnschema to rhnuser; \q psql -d rhnschema CREATE LANGUAGE 'pltcl'; CREATE LANGUAGE 'pltclu'; \q
[postgres@pgsql01 ~]$
Switch over to the Spacewalk-server and run the setup again to setup the db and give it the external db.
The installer will ask you what hostname (IP-Address), user and database it should use.
sudo spacewalk-setup --dbonly --external-postgresql
[archy@spacewalk ~]$
If the installer is finished. import the sql-dump into the spacewalk-database. Run
on the Spacewalk-server.
sudo spacewalk-sql -i < spacewalk_migration_backup.sql
[archy@spacewalk ~]$
You can now start the spacewalk-services again by issuing
This completes it.
spacewalk-service start
[archy@spacewalk ~]$ sudo
Feel free to comment and / or suggest a topic.
Comments
Post a Comment