Matrix Synapse and Riot migration - amazon-ec2

how can I migrate all my data and configuration for matrix synapse and Riot.Im installed on the system to another one VM ?
Can I backup and restore all the rooms (created with Riot.IM) , the chat logs and the users and migrate all the content to another machine ?
The old system is configured without using docker.
Thank you

Information
All the applications are decentralized and there will be configurations file which are holding your server and connection information, Remaining all the data is stores in the Database which you are using. So we have client in your case Riot , Matrix Synapse and Database(Migration)
Riot Migration
We have a configuration file named config.json (default) which has the URL's of your synapse server. While Migrating copy the values of the from your existing riot config file to your new riot config file.
Synapse Migration
Similar to the Riot there is a homeserver.yaml and conf.d/server_name.yaml files in matrix-synapse installation folder, which has all the configurations. Copy the contents from these files to new matrix files and you are done with client and interface, Let's get into Data Migration.
Database Migration
SQLITE3 to PostgreSQL follow the command
create dump file from sqlite
sqlite database .dump > /the/path/to/sqlite-dumpfile.sql
copy that sql dump file to PostgreSQL
/path/to/psql -d database -U username -W < /the/path/to/sqlite-dumpfile.sql
Old PostgreSQL to new PostgreSQL
Create a dump file as backup from older PostgreSQL
pg_dump dbname > outfile
Restore the data from this dump
psql dbname < infile
Using Database migration GUI tools such as Pentaho or dbsoft . Follow the dbsofts article
You can refer to element docs on migration, matrix docs and SQLite to PostgreSQL

Related

is it possible to Nifi application backup and restore?

Is there a way to backup & restore apache Nifi application data like nifi-flow-audit.h2.db & controller services configuration data?
The controller services configuration is serialized into $NIFI_HOME/conf/flow.xml.gz. You can copy this file to any NiFi instance with the same nifi.sensitive.props.key value in $NIFI_HOME/conf/nifi.properties and it will be used to define the entire flow (CS, processors, reporting tasks, etc.).
The nifi-flow-audit.h2.db is a local database containing the audit records of the flow changes. You can copy that file to remote disk and restore it from there as well.
In general, you want to back up everything in the $NIFI_HOME/conf directory to restore the application configuration, and the three repositories (content_repository, flowfile_repository, and provenance_repository) if you want the exact state of the application. More information on the repositories and setting up NiFi for easier upgrades here.
Check out the backup options in Nifi Toolkit's File Manager.
Sample command
# backup NiFi installation
# option -t may be provided to ensure backup of external boostrap.conf file
./file-manager.sh
-o backup
–b /tmp/nifi_bak
–c /usr/nifi_old
-v
Source: https://nifi.apache.org/docs/nifi-docs/components/nifi-docs/html/toolkit-guide.html#file-manager

How can ddev automatically create additional databases?

This is a followup question to How can I create and load a second database in ddev?. It is about doing that task automatically.
One use case for this is developing a migration to Drupal from another MySQL database, and collaborating with others on the migration. If the database name can be set by ddev, additional developers can get the database created automatically, and additional databases can be added to their settings.local.php, using known values.
Try this in your project's config.yaml:
hooks:
post-start:
- exec: mysql -uroot -proot -hdb -e "CREATE DATABASE IF NOT EXISTS another_db; GRANT ALL ON another_db.* TO 'db'#'%';"

Teamcity upgrade from 9.16 to 10

I want to upgrade Teamcity 9.16 to 10. I want to proceed with manual back-up and then restore it . I am using external database - mysql . i want to upgrade database as well. How should i proceed with this?
TeamCity documentation states that
Backups created with TeamCity 6.0+ can be restored using the same or
more recent TeamCity versions
so you should be able to create a backup in TC9 and then restore it in TC10.
The simplest way to create a backup is to navigate to the Administration | Backup section in the server UI to specify some parameters and run the backup, as described here.
The other options are
backup via the maintainDB command-line tool — it is basically the same option, as backup via the UI
manual backup
which are described on the corresponding page of the TC documentation.
Restoring data from backup is performed using the maintainDB tool, basically the steps for your case are:
install new TeamCity (but do not start the server)
create a new empty Data Directory
create and configure an empty database
configure a temporary database.properties file
place the database drivers into the lib/jdbc in new data directory
use the maintainDB utility located in the <TeamCity Home>/bin to run restore command:
maintainDB.[cmd|sh] restore -A <absolute path to the Data Directory> -F <path to the TeamCity backup file> -T <absolute path to the database.properties file>
If the process completes successfully, copy over
/system/artifacts from the old directory
More details could be found on the corresponding page.

How do I connect mongodb to an existing set of database files

I downloaded a mongoDB database, meaning I got a set of XXX.0 [xxx.1, ...] and XXX.ns files. I installed mongoDB (on Mac OS X using Homebrew) and ran mongod with the dbpath parameter pointing to a directory with these files in it. However, when I use the mongo shell and ask to see available databases or collections, I get nothing but the 'local' database and no collections. What am I doing wrong? how can I get mongoDB to 'see' the database in the directory?
Thanks,
Yariv.
Based on the database files naming that you have downloaded, the files were generated using MongoDB MMAPv1 storage engine. As if it were generated with MongoDB WiredTiger storage engine, you would have collection.*.wt files.
Now, if you have just installed through homebrew the latest stable version of MongoDB which is currently v3.2. This would have come with the new default storage engine of WiredTiger.
If you also have the local.<n> and local.ns files in the directory, MongoDB would give you an error stating incompatibility of storage files like below:
[initandlisten] exception in initAndListen: 28662 Cannot start server. Detected data files in /data/target created by the 'wiredTiger' storage engine, but the specified storage engine was 'mmapv1'., terminating
Without these files mongod will run with WiredTiger storage engine and would ignore the existing(copied) MMAPv1 files.
If this is your case, you can run mongod with the --storageEngine option to specify MMAPv1. This would set mongod to run with MMAPv1 storage engine. Example:
mongod --dbpath <your db files dir> --storageEngine=mmapv1
Also for the record, checkout mongodump and mongorestore to export/import the database contents in binary format instead of copying the database files.

Restore Oracle Database From Oradata Folder

I have lost my database on the server because the computer has been formatted on drive C. But the oracle folder was located on Drive E, like oradata, etc. Can I restore oracle database like before?
Well, first you need to install the oracle server with the version which was there before formatting.
Follow these steps:
Install the same Oracle database version with the starter database.
Copy all control files, datafiles to oradata directory
Copy init.ora filr to ADMIN folder
Revise the init.ora file for the changed control file, archive and dump locations. (keep instance, SID, and global db name the same)
Create the instance by running oradim with the pfile(init.ora) location
Connect to DB using internal and mount it.
Check existing data and logfile locations by typing:
SELECT name FROM V$DATAFILE;
SELECT member FROM V$LOGFILE;
Now change the file locations that come up above by using:
ALTER DATABASE RENAME FILE <old file loc list> to <new file loc list>;
After renaming them open the database by alter database open.
And you should be set.
Reference

Resources