Hot answers tagged

36

oldserver$ mysqldump mysql > mysql.sql newserver$ mysql mysql < mysql.sql newserver$ mysql 'flush privileges;' Should do it, remember to add -u $USER and -p$PASSWORD as required


25

Execute your sql query in the SQL tab of phpMyAdmin. After execution, scroll down the page and look for “Query results operations” Click “Export” link from the above and you will get the page to export all the results of the queries to desired format. That’s it.


17

nfs-kernel-server cannot work with a FUSE folder like an encrypted ecryptfs home directory.


15

I would take a look at the Percona Toolkit. The description of the pt-show-grants tool says it all... pt-show-grants extracts, orders, and then prints grants for MySQL user accounts. Why would you want this? There are several reasons. The first is to easily replicate users from one server to another; you can simply extract the grants ...


13

To backup: sudo dpkg --get-selections > /tmp/dpkglist.txt To Restore: sudo dpkg --set-selections < /tmp/dpkglist.txt sudo apt-get -y update sudo apt-get dselect-upgrade Also see this question for additional options and info: http://serverfault.com/questions/737/ubuntu-how-to-setup-a-new-machine-like-an-existing-one I have the above running in a ...


12

Whilst a dump of the mysql database would probably work, in my experience, properly documenting all the access and setting it up again with GRANT statements is much better. There are two benefits to doing it this way: You will understand your database security and how it is implemented. You will get to remove access that is no longer required.


8

It's a lot simpler then that: Use DCPROMO to make a new Domain Controller. Move the Functional Roles from one to the other. Schema Master (from the AD Schema MMC) Domain Naming Master (from AD Sites and Trusts) Relative ID Master (from ADU&C) Primary Domain Controller Emulator (from ADU&C, only useful for NT services) Infrastructure Master (from ...


7

aptitude also satisfies this usecase, and it preserves information about "automatically installed" packages that other methods do not. Run the following on the reference machine: aptitude search -F '%p' '~i!~M' > package_list Copy package_list to the other machine and run xargs aptitude --schedule-only install < package_list; aptitude install;


7

In the Exchange Management Shell New-MailboxExportRequest It will request a filepath, which is relative to the Exchange server holding the mailbox, and must be accessibly by the same user that the store.exe process is running as (typically the machine account). It will also ask for the Mailbox, specify by the alias. You can get an update of what it's doing ...


6

This has already been solved here http://serverfault.com/questions/8860/how-can-i-export-the-privileges-from-mysql-and-then-import-to-a-new-server/13050#13050


6

I've used DNSShell before. http://dnsshell.codeplex.com/. To get all A records in a zone you can do this: Get-DnsRecord -RecordType A -ZoneName FQDN -Server ServerName To get this into a text file: Get-DnsRecord -RecordType A -ZoneName FQDN -Server ServerName | % {Add-Content -Value $_ -Path filename.txt}


6

Another method I don't see mentioned yet: Get-WmiObject -Namespace Root\MicrosoftDNS -Query "SELECT * FROM MicrosoftDNS_AType WHERE ContainerName='domain.com'" WMI is good to remember when you can't download DnsShell for some reason, or if you're on an older version of Powershell that doesn't have the baked-in Cmdlets, or if you're targeting an older ...


5

The accepted answer (using mysqldump to backup mysql.user table) is a very dangerous approach if you are migrating to a new server version. I did that in the past (migrating users from Mysql 4 to Mysql 5.1), and later I had problems trying to grant or modify privileges to my database users. This happens because mysql.users table structure differs between ...


5

I believe that true Bourne shell (/bin/sh on many commercial Unix variants) does not support the assignment and export in a single statement. This is how I remember it from my days on Solaris. I don't know if the new Solaris versions use bash by default now. Regardless, your latter case is more portable so I'd stick with that.


5

Starting from Oracle 11gR2 (11.2.0.1) there is a new feature: Deferred Segment Creation: the creation of a table sent is deferred until the first row is inserted. This results as empty tables not being listed in dba_segments and not being exported by exp utility. The easiest solution is to use expdp utility. If you have to use exp utility, you must run ...


5

You're executing the script by running "sh myscript.sh". If you invoke bash with "sh", bash will try "to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well" (according to the man page for bash, in the Invocation section). The historic Bourne shell doesn't recognize "export VARIABLE=...


5

It appears (judging from the 'e$' in the screenshot) you're trying it from a client workstation using the Hyper-V Manager. Try logging into the virtual host and exporting it to a drive that is local to that host machine. Unfortunately if this does work, it does not explain why what you are doing isn't working. I was able to verify the ability to ...


5

You're almost right, try this: id name address.0.line1 address.0.line2 address.0.city address.0.country address.0.postcode I inserted your sample document into collection bar in database test and then ran the export like this: ./mongoexport --port 31000 -d test -c bar -fieldFile fields.txt --csv > out.csv Then checked the results, which look good to ...


4

mysqldump will work, but since the mysql database uses ISAM, you can just copy the directory to the new server. You'll find this in different places, but the most common location for the mysql database will be /var/lib/mysql/mysql. Be sure to stop mysql on the new server, move the old directory out of the way, copy the directory and restart. An example using ...


4

Unfortunately, with the modular nature of group policy extension handlers I don't believe you're going to find any tool better than Group Policy Management Console to do what you're after. Your easiest path is going to be to either use a computer joined to the domain to run GPMC and examine / export the GPOs. Of course, if there are GPOs that have had ...


4

Exporting private keys on certificates that have been marked non-exportable? Uh, how about an article I wrote about a tool called Jailbreak...


4

This works on Windows 2003 server and is likely to work on other Windows OS's, too. It looks for any sub-directories in the specified "repos" directory and tries to run a svnadmin dump on each and every one of them. It creates dump files named (reponame).svn dump_repos.bat cd \my\subversion\repos dir /A:D /B> dirs.tmp FOR /F %%i IN (dirs.tmp) DO ( "C:\...


4

Using the SQL Management Studio you can use the Generate Script functionality to generate an SQL script to create some or all of the objects in the database, suitable for execution on another server.


4

See Options > Query Results > SQL Server > Results to Text Check "include column headers". My text results are being enclosed in doublequotes so that should take care of the comma issue. Take a look at the "Results to grid" tab as well - I see a "Quote strings containing list separators when saving .csv results" If not through SSMS then you can also use ...


4

mysqldump - read the man page for details. Note that it may take a time to generate the full backup file - if you want a consistent backup then consider setting up a replication slave (and turn off replication while taking the backup).


4

If you have a large database which you want to keep online (i.e. not read lock) during backups you can also consider the innobackupex script which uses xtrabackup from percona which supports online backups of both inno and myisam (to some degree of consistency) Zmanda has a ZRM manager product which wraps the mysqldump tool and combines a scheduler and ...


4

You have to generate the list of tables you want to dump then act upon it. mysql -u USER -p -D test -Bse "show tables like 'wiki_%'" >tables.out mysqldump -u USER -p test <tables.out >wiki_tables.dump or as a one liner mysqldump -u USER -p test $(mysql -u USER -p -D test -Bse "show tables like 'wiki_%'") but you still get to enter the password ...


4

Instead of the export button at the top of the GUI, use the one at the bottom, within the "Query results operations" box. That is the one you want.


4

I suspect the tool you may want to look at is ldifde. It will not export passwords (password hashes) though (ref). Getting passwords hashes out of the AD is pretty difficult by design.


4

It sounds like what you are looking for would be best handled by an SVN hook script. Hook scripts basically exist on the SVN server, and can be used to automatically perform actions, like doing an and updating files. Though your question mentions FTP I strongly suggest you consider using ssh/scp/rsync instead. You could possibly just have your hook ...



Only top voted, non community-wiki answers of a minimum length are eligible