how to redirect the database when doing taosdump restore - tdengine

how could redirect the database when doing taosdump restore in TDengine database V2.6 ?
I want to put my data dumped out into a new database with a new configuration .
Because I want to change the "update" configuration .
how should I implement ?

after dumpout from taosdump , it will create a dbs.sql in the path.
you could change the dbname in the "create database xxxx" and other parameter you want to change.
then run "taosdump -i pathname "
this is the correct way for TDengine database restore data to a new database .

Related

Load database from offline back-up Neo4j

I backed up a neo4j database using
bin/neo4j-admin dump --database=neo4j --to=c:/
Then I load a database from an archive created with the dump command as follow
bin/neo4j-admin load --from=/var/lib/neo4j/data/c: --database=db
From Neo4j Enterprise Browser I execute
SHOW DATABASES
but I don't see the db previously loaded. How could I show it ?
If you are replacing your existing database with name "db" then use the --force option:
bin/neo4j-admin load --from=/var/lib/neo4j/data/c: --database=dbase --force
If you are restoring into a new database, then after the load, you need to create the database CREATE DATABASE dbase
Note that I changed the name of your database from db to something else since database names in Neo4j must be at least 3 characters long.

Import/Export PostgreSQL db "without" pg_dump or sql file / backup, etc...?

I need to import a old db into a new postgre server.
Is there a way to migrate an old database to a new server without using pg_dump?
I don't have the sql file, or the old server backup file, neither the user and the password, just the physical files in the "\data" folder, is there any way to do this?
The target server is in the same version of th old server.
Thanks.
Well as a test you could try:
pg_ctl start -D $DATA
Where pg_ctl comes from the target version and the $DATA is the the /data directory. You have not said how you came to have just a /data directory. If this came from an unclean shutdown or a corrupted drive the possibility exists that the server will not start.
UPDATE
To get around auth failure find pg_hba.conf and create or modify local connection to use trust method. For more info see pg_hba and trust. Then you should be able to connect like:
psql -d some_db -U postgres
Once in you can use ALTER ROLE to change password:
ALTER ROLE <role_name> WITH PASSWORD 'new_password';

Restore DB2 backup to another DB2 database with different name

I have a DB2 10 database backup file that I would like to restore to another environment. The problem is that the database has been setup with a different name and the restore complains because the database names are different.
Is there a way to restore the database backup file to the other environment?
Thanks
Here is the command I used to restore:
db2 "RESTORE DATABASE <restore database name> FROM <current restore directory> TAKEN AT <timestamp of full backup> TO <Local database directory> INTO <new database name>"
Example:
Database name of original backup is:
SYSTEM
My backup directory is:
/db2inst1/archive/backup/SYSTEM/level0/
Timestamp of original backup is:
20180503141925
Local database directory is: I would redirect this directory to your database standard list
New database name is:
SYSTEM2
Example output command is:
db2 "RESTORE DATABASE system FROM /db2inst1/archive/backup/SYSTEM/level0/ TAKEN AT
20180503141925 TO /db2inst1/ INTO system2"
Once complete roll-forward database:
db2 "ROLLFORWARD DB SYSTEM2 TO END OF LOGS AND COMPLETE"
You can use the "redirected" restore option by generating a file
db2 restore database mydb redirect generate script restore.sql
Once the script is generated, you can change the names, file locations, etc.
And finally, execute the script
db2 -tvf restore.sql
Thanks for the help.
In the end we dropped the existing database, restored the database from the backup file and then renamed the restored database to match the previous database name

OpenERP 6.1 Database Migration to new VPS through shell

I've been trying to migrate my old openerp server installation to a new VPS so I tried to migrate the database.
I need to do it via shell because of the size of the database and unstable connection.
What I've done is log in server1 and then
su postgres
pg_dump dbname > db.dump
then I transfered the file to the new server and restored it like this
createdb dbname
psql dbname < db.dump
the database itself was restored and I can browse through the tables if I want to but when I try to get in OpenERP the database is not available in the select box where the databases are. If I create new databases by using the openerp interface they appear correctly in the select box and I can connect.
I tried to create the db with UTF8 encoding and using template1 as well but nothing was different. I also tried to create the database via the interface, drop the tables and restore the backup but this gives errors after I log in like "product.product relation does not exist".
Any ideas what else I could try? Thanks in advance.
When restoring the database take care to restore it with the correct ownership.
You may want to take a look at this question

How to take database backup form WSO2 Stratoes Live Data Services Server

I have created database on the Stratoes live server and my databse URL is this.
jdbc:mysql://rss1.stratoslive.wso2.com/karshamarkuptool_karsha_opensource_lk
I tried Database Console> Tools> Back Up and it asking me these credentials
Target file name:~/backup.zip Source directory:
jdbc:mysql://rss1.stratoslive.wso2.com/karshamarkuptool_karsha_opensource_lk
Source database name: karshamarkuptool_karsha_opensource_lk
Are my credentials right? it says there is no database found on the source directory.
If not what is the way to get a backup from Stratoes database? How can I configure it to get automatic weekly backup?
If you have mysql installed in your local setup, you can get a backup as just as the same way that you would take a backup of a database that resides in your local database server. For example, the following command would get you a backup of your database that you created under the RSS manager of StratosLive Data Service Server.
mysqldump -u your_username -pyour_password -h rss1.stratoslive.wso2.com extracted_host_name_from_the_JDBC_url_given_to_you database_name > local_file_system_path/backup.sql
Cheers,
Prabath

Resources