SVN,GIT and Mongo -Ubuntu

How to do SVN backup 
svn dump /home/testuser/svn/phpcode/ | gzip -9 > php_7_04_2014.dump.gz

Secure copy remote to local
scp ubuntuuser@ipaddress:’/home/location/php_7_04_2014.dump.gz’ /home/user/mybackup

Add SVN user
sudo htpasswd /etc/subversion/passwd test

clone with git(bitbucket) branch
sudo git clone -b phpcodebr_1.22 https://username@bitbucket.org/Test/test.git phpcodebr_1.22

GIT commit history  : git log -1

Creating tag from a previous commit
1. sudo git tag reponame_v_1.2.0.0 9170d1b
note:9170d1b is SHA1 ,we can see in the commit-log
2.sudo git push –tags

 

Mongo:
mongo conection with auth
mongo ipaddress -u myadmin -p 123456 –authenticationDatabase admin

Create a mongoDB user with authentication
db.createUser(
… {
… user :”testUser” ,
… pwd : “testUser123” ,
… roles :[“readWrite”, “dbAdmin” ]
… }
… )

Mongo dump with authentication
sudo mongodump -h yyyy.xxxx.com -u username -p password –db dbaname

Mongo restore
sudo mongorestore -h xxxx.yyyy.com:27017 -u USERNAME -p PASSWORD -db DBNAME DUMPPAHT/DUMPNAME

Mongo database copy with authentication
db.copyDatabase(‘existing_db’,’new_db_name’,’localhost’,’username’,’password’);

Override local copy by the repository copy.

git fetch origin
git reset --hard origin/master
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s