w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to backup and restore gradle
If the build uses libraries from Maven or Ivy repositories, you'll have to let Gradle download them again. (There isn't currently a reliable way to transfer the Gradle dependency cache between computers.) Assuming the build doesn't reference any files outside the project directory (which hopefully is the case), what's left to transfer is the project directory (best via source control) and any personal gradle.properties or init.gradle that you might have in ~/.gradle. If you happen to work with a manual Gradle installation, you'll also have to transfer the Gradle installation directory and any changes you made to your environment (e.g. you might have put the gradle startup script on your PATH). Instead I recommend to switch to the Gradle Wrapper.

Categories : Gradle

Backup/Restore to sdcard in Android
I do it like this: export: InputStream myInput; String dbpath = "/data/"+pckgname+"/databases/refuel_db"; String sdpath = Environment.getExternalStorageDirectory().getPath(); try { myInput = new FileInputStream(Environment.getDataDirectory() + dbpath); // Set the output folder on the Scard File directory = new File(sdpath + "/Refuel"); // Create the folder if it doesn't exist: if (!directory.exists()) { directory.mkdirs(); } // Set the output file stream up: OutputStream myOutput = new FileOutputStream(directory.getPath() + "/refuel_db");

Categories : Android

Can't restore database from backup file
The database is left in a recovering state because you specified: NoRecovery = true If you want the database to be recovered after the restore, change this line to: NoRecovery = false More info in the Comparison of RECOVERY and NORECOVERY section here.

Categories : C#

How can I backup and restore MongoDB by using pymongo?
Let me answer this question in two parts Does pymongo provide an API to enable a backup or export of collections and rows? As of now, No. It does not provide a binding method for backup/mongodump Can one use pymongo to enable a backup or export of collections and rows? Yes. lets assume we have a collection col with the following documents in it { 'price':25, 'name':'pen' }, { 'price':20, 'name':'pencil' }, { 'price':10, 'name':'paper' }, { 'price':25000, 'name':'gold' } Our aim is to backup all documents which satisfy the condition that their price is less than 100. Using pymongo's find function. this can be done by db.col.find({'price':{'$lt': 100}}) The above code returns a cursor object. All the documents that we need for the backup is in that cur

Categories : Python

Mysql how to backup and restore after version 5.5
I would copy the *.MYD and *.frm files into the target database directory, and then run a REPAIR TABLE on each table (so as to rebuild the indexes). The "target database directory" is datadir/dbname where datadir is a server parameter, and dbname is your target database name. datadir is found with the SQL command SHOW VARIABLES LIKE 'datadir';.

Categories : Mysql

How to backup/restore Rails db with Postgres?
Does the register_development database exist before you run the psql command? Because that form will not create it for you. See http://www.postgresql.org/docs/8.1/static/backup.html#BACKUP-DUMP-RESTORE for more information.

Categories : Ruby On Rails

Restore Wordpress Database Without Backup
I'm not a programmer or a sql expert, but do have a lot of hosting experience and I can tell you this for sure - if all you have are the Wordpress files (the files in your hosting account) but you don't have a copy of the actual database (usually a .sql file or gzip of it) then you cannot simply restore your Wordpress site content. The files in your hosting account - the Wordpress files such as index.php and so forth - are not where your posts and page content are stored. They are just files that tell Wordpress how to function. All of your references to the actual content of your posts and pages are stored in the database of your Wordpress. So, you need the database backup in order to restore your Wordpress to what it was before your mishap. If you're on typical shared hosting (such as

Categories : Database

hsqldb no change after backup restore until restart
You should not attempt to restore the database from a backup while the server is running. First SHUTDOWN the database, then restore, follow by restart. You can run the server with remote_open, which allows you to shutdown the database without shuting down the server. After restoring the backup, you simply connect to the database again.

Categories : Java

MongoDB replica set to stand alone backup and restore
No matter how many nodes you have in a replica set, each of them holds the same data. So getting the data is easy - just use mongodump (preferably against the secondary, for performance reasons) and then mongorestore into a new mongod for your development stand-alone system. mongodump does not pick up any replication related collections (they live in database called local). If you end up taking a file system snapshot of a replica node rather than using mongodump, be sure to drop the local database when you restore the snapshot into your production stand-alone server and then restart mongod so that it will properly detect that it is not part of a replica set.

Categories : Mongodb

Unable to restore a MYSQL backup to a new Database
This is probably caused by coding systems. My dump file is generated using redirection (">") in powershell and I encountered the same problem. The output redirection generated a file with UTF-16 Little endian. However, this can be solved by converting the dumpfile into utf-8. This can be done in emacs as: M-x set-buffer-file-coding-system Then save the file and import again. The coding system of a file can be detected using GNU "file" utility, and it also available in windows and can be found here: http://gnuwin32.sourceforge.net/packages/file.htm For future use, a better dump command is like: mysqldump <dbname> -r <filename>

Categories : Mysql

How to restore Mysql Backup from dump file?
If it's a dump file that you created using mysqldump, then you can build a new database from the dump file using the source command. Just login to MySQL using mysql -p, enter the root mysql password, then type: source /path/to/mysqldumpfile

Categories : Misc

Backup and Restore database MDF C# WinForm didnt work
You can try to use public void BackupDatabase(String databaseName, String userName, String password, String serverName, String destinationPath) { Backup sqlBackup = new Backup(); sqlBackup.Action = BackupActionType.Database; sqlBackup.BackupSetDescription = "ArchiveDataBase:" + DateTime.Now.ToShortDateString(); sqlBackup.BackupSetName = "Archive"; sqlBackup.Database = databaseName; BackupDeviceItem deviceItem = new BackupDeviceItem(destinationPath, DeviceType.File); ServerConnection connection = new ServerConnection(serverName, userName, password); Server sqlServer = new Server(connection); Database db = sqlServer.Databases[databaseName]; sqlBackup.Initialize = true; sqlBackup.Checksum = true; sqlBackup.ContinueAfterError = true; sqlB

Categories : C#

Backup and restore sqlite from disk to memory in Java
It looks like you are missing two things: 1) The quotes around the file name, and 2) stat.close. Try the following: this._conn = DriverManager.getConnection("jdbc:sqlite:"); Statement stat = this._conn.createStatement(); File dbFile = new File(this._config.GetDataBaseFile()); if (dbFile.exists()) { this._logger.AddInfo("File exists."); stat.executeUpdate("restore from '" + dbFile.getAbsolutePath() + "'"); stat.close(); } That was the only way I could get it to work with Xerial SQLite JDBC version 3.7.15-M1. I do not think that the version matters much in this case.

Categories : Java

Illegal characters in path during database backup and restore C#
You need to look at Path.GetInvalidPathChars Method to determine the list of invalid characters. The array returned from this method is not guaranteed to contain the complete set of characters that are invalid in file and directory names. The full set of invalid characters can vary by file system. For example, on Windows-based desktop platforms, invalid path characters might include ASCII/Unicode characters 1 through 31, as well as quote ("), less than (<), greater than (>), pipe (|), backspace (), null () and tab ( ). And if I am not mistaken I see a pipe (|) character in the file names you have provided.

Categories : Sql Server

Auto restore SQL Server database backup for test
First you should set up your database mail Then you should create a Sql Server Agent job with a query , That you can get from restore page with script as new query window. then you should create an operator in Sql Server Agent to send e-mail by your desired database mail . in your job you can specify that on job failure or job success or both , the operator send to email you. If you want to delete the restored table , you can create a table for the result of the restore, and in your restore code , you can modify a try/catch within a transaction state, if the restore was successful insert into table and commit transaction , else it delete table. You should create other job in Agent and execute a query to look for commit in that table , if true then delete restored database, else you can wr

Categories : Sql Server

backup/restore openrdf-sesame repository in production
You can quite easily create something yourself, just by using RepositoryConnection.export. However, there are also a few ready-made (commandline) tools available, for example this simple sesame-backup tool (disclaimer: I developed that). Download, install, and stick in a cronjob to have it make regular scheduled backups.

Categories : Misc

Windows Azure Active Directory Backup/Restore
You could consider using some of the Windows Azure Active Directory PowerShell Cmdlets to save your configuration. The various Get- Cmdlets (see http://technet.microsoft.com/en-us/library/jj151815.aspx) should allow you to save all your configuration settings, users, roles, etc.

Categories : Azure

How to backup and restore python current working environment?
You should take a look on pickle documentation. You also have an example that can help you to do what you're thinking on.

Categories : Python

How to restore large size backup in sql server 2012?
If you are using SQL Servere 2008 R2 Express edition the maximum size of one DB is 10 GB Maximum database size database as follows in express editions, SQL Server 2012 10GB SQL Server 2008 R2 10GB SQL Server Express 2008 4GB

Categories : SQL

Backup a local database and restore to remote server using single command
I would build a script that checks the connection first then if all ok, does the transfer. Once this script is tested you can call it once for each of your 43 databases. Some may fail, but your script will tell you which (if it reports errors properly). Then work out what is causing any failures. Eventually you will get all 43 going. The backup script you end up with will use the code you have posted, but it will be more general and will have checking and reporting. Why don't you post it here when you have it working? Greg Ambrose

Categories : PHP

Automate SQL Server 2008 backup and restore on shared hosting with limited permissions
In case you don’t have full access to SQL Server and the machine that is running it you can’t really initiate a restore command (maybe there are some workarounds but I’m not familiar with any). What you can do if SQL Server is on a public IP address is setup some kind of replication between two servers so they synchronize automatically. Again, not sure if this is possible w/o full access to machine but you can give it a try. Final solution would be to use one of the third party comparison and synchronization tools to synchronize databases at a given time. Just find a tool that has command line interface such as Data Diff from Apex. Another one you can use is Data Compare from Red Gate but I’m sure there must be others too. Note that these tools are not free …

Categories : Sql Server

Trying to Restore Entries from Backup Table to Main Table
I found something for that on the Internet: http://forums.databasejournal.com/showthread.php?9438-Turning-IDENTITY_INSERT-ON&p=21383#post21383

Categories : PHP

open Camera Roll from Java Script method in iOS
Starting in iOS6, you can access the Media Capture API which allows you to request files from the user via <input type="file" />. Essentially, all you need to do is include an <input type="file" /> and when the user touches the input, it will open the phone's camera roll. Once the user has selected the file, you can send the file using the POST form action or AJAX, or use the File API to manipulate the file data on the client side. Check out the HTML Media Capture specification from the W3C for more information on implemention.

Categories : Javascript

How to Roll Up and Roll Down Delphi form with "bsSingle" style?
You can call Repaint in each iteration of setting the height of the form to get rid of the background problem. .. for Height := OldClientHeight downto 0 do begin ClientHeight := Height; Repaint; end; .. You don't have to switch the borderstyle for your animation to work. The reason that your code fails is that the ClientHeight of a fixed border window is never 0 by default. In any case, calling Application.ProcessMessages, you depend on the processing capability of the machine that the program is running on for animation speed. Using a TTimer would avoid that. An example could be like this: TForm1 = class(TForm) .. private FOldClientHeight: Integer; FContracted: Boolean; protected procedure WMNCLButtonDblClk(var Msg: TWMNCLButtonDblClk); message

Categories : Delphi

Finding most recent file in batch script
Unsure about a few things in your question. If there is a known phrase in the filename you want, you can filter for it with find, like this: for /f "delims=" %%x in ('dir /od /a-d /b ^| find /i "_9_error"') do set recent=%%x Note the ^ to allow use of the pipe. If the file has known content, you can similarly figure out which one to use using find. If neither the filename nor content has anything to filter for, and the timestamp is the same, you're stuck.

Categories : Batch File

Table data backup through unix script
The less tedious way is to use the temporary table approach unfortunately, preferably in a different schema of course. Keeping all the operations and data in the database will be faster and more simple to code, and more reliable. Alternatively you could use FLASHBACK TABLE if this is not a lengthy timescale and no other changes occur on the data. If other changes do occur then it would only be slightly more complex to use a flashback query clause to restore the old data.

Categories : Oracle

Syntax error in mysql backup script
You forgot to open a bracket "(". Try this: table_types=($($MYSQL -u $DB_USER -p$DB_PASS -e "show table status from $DB" | awk '({ if ($2 == "MyISAM" || $2 == "InnoDB") print $1,$2}'))

Categories : Mysql

Backup Computer Using Batch Script to external HDD
robocopy path osource path odest /XO /E /Y or something like fastcopy.exe /cmd=diff /speed=full /force_start /no_confirm_del /auto_close "path osource" /to="path odest"

Categories : Batch File

Duplicity backup script for S3 fails on CentOS 5
You should remove commented lines from script execution. From: duplicity ${FULL} --encrypt-key=${GPG_KEY} --sign-key=${GPG_KEY} --volsize=250 # --include=/vhosts # --include=/etc --include=/home --include=/root --exclude=/** ${SOURCE} ${DEST} >> ${DAILYLOGFILE} 2>&1 to duplicity ${FULL} --encrypt-key=${GPG_KEY} --sign-key=${GPG_KEY} --volsize=250 --include=/home --include=/root --exclude=/** ${SOURCE} ${DEST} >> ${DAILYLOGFILE} 2>&1 Regards.

Categories : Misc

Forward data from php script to calendar
So if i get you right, you could post your data to the calendar via curl: $url = "http://www.your-url-to-the-calendar.com"; $postData = array( "prop1" => "value1", "prop2" => "value2", "prop3" => "value3" ); //urlify the data for the post $data_string = ""; foreach ($postData as $key => $value) $data_string .= urlencode($key) . '=' . urlencode($value) . '&'; $data_string = rtrim($data_string, '&'); //will output --> prop1=value1&prop2=value2=prop3=value3 $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => $url, CURLOPT_HEADER => false, CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => false, CURLOPT_POST => count($postData), CURLOPT_POSTFIELDS => $data_string )); $result = curl_exec($

Categories : PHP

What is the ideal way to take backup of a configuration file using perl script, which you are going to edit
Typically I'd create a file with a name based on the original file's name: my $file = 'input.txt'; my $new_file = "$file.new"; Start reading lines from the input file, and manipulate them as necessary before writing them to the new file. When you reach the end-of-file of the input file, close them both. Rename the input file to "$file.old", then rename the new file to the old name $file. You want to keep the original file intact as long as possible so it remains available in case something fails during processing. If you have to roll back, reverse the rename process if processing completed. If processing didn't complete just delete the new file.

Categories : Perl

MSSQL find most recent measurement of most recent visit where person seen within the last year
I would approach this problem differently altogether. You have 3 problems to solve. what is the top visit per person per doctor in last 12 months what is the most recent measurement per visit only show results for Dr. Jones as primary care physician The first two can be solved with a view or CTE and then joined against. I recommend separate views so you can evolve your application logic (if the definition of mostrecent whatever changes, you update that view). Here is a CTE example though to see it all in one place: old: http://sqlfiddle.com/#!3/3552e/8 new based on per patient per doctor: http://sqlfiddle.com/#!3/660be/3 with mostrecent_visits_per_patient_per_doctor as ( select a.patientid,b.doctorid,max(b.visitdate) visitdate from patients a join visits b on a.patienti

Categories : SQL

sql select and compare most recent and nth most recent value but exclude when value has been repeated for more than three months
You're on the right track. You can use max(case when...) to pluck out the specific previous periods to compare. Like so: SELECT meternumber, MAX(CASE WHEN myrank = 1 THEN readdate ELSE NULL END) curr_date, MAX(CASE WHEN myrank = 1 THEN waterread ELSE NULL END) curr_read, MAX(CASE WHEN myrank = 4 THEN readdate ELSE NULL END) ago3_date, MAX(CASE WHEN myrank = 4 THEN waterread ELSE NULL END) ago3_read, MAX(CASE WHEN myrank = 7 THEN readdate ELSE NULL END) ago6_date, MAX(CASE WHEN myrank = 7 THEN waterread ELSE NULL END) ago6_read FROM ( SELECT MeterNumber, ReadDate, WaterRead, Rank() over (Partition BY MeterNumber ORDER BY ReadDate DESC ) AS myRank FROM WaterReads WHERE readdate <= '2013

Categories : SQL

SQL Azure automated backup fails on a DB which has been deleted - cannot remove backup task
Response from SQL Azure team: Hello, We have investigated the issue and should have a fix soon. In the meantime I would recommend creating a filter for these emails. Once the fix is rolled out you can remove the filter (I will respond back to this thread once it is). If you do not want to receive any failure emails you can opt-out permanently via the Unsubscribe link at the bottom of the email. Note, however, that this is permanent and will apply to all export failure emails: once you have opted out there is no way to opt back in later. Apologies for the inconvenience, -Stephen

Categories : SQL

Second most recent MMS received instead of most recent in Android
I, myself, have not done the whole process exactly but am currently researching it and this is what I have learned thus far. I recall reading before that listening for android.provider.Telephony.WAP_PUSH_RECEIVED will only notify you of an incoming MMS. My understanding is that the intent is more of a receipt and does not actually mean the MMS is in the phone yet, or more precisely, in the database to pull from. That may explain why you are only getting the second to last. If you want to get the MMS when it's finished and ready to be pulled from the database, I think you'll need a ContentObserver to notify you of database updates.

Categories : Android

Exist script when any command fails
In your script, say set -e # some arbitrary command apt-get install -y apache2 # more commands This would make the script exit if any subsequent command returns with non-zero exit code and would obviate the need of placing || exit besides every command in your script. From the manual: -e Exit immediately if a pipeline (see Pipelines), which may consist of a single simple command (see Simple Commands), a subshell command enclosed in parentheses (see Command Grouping), or one of the commands executed as part of a command list enclosed by braces (see Command Grouping) returns a non-zero status. The shell does not exit if the command that fails is part of the command list immediately following a while or until keyword, part of the test in an if statement, part of any

Categories : Shell

How do I select one most recent of each group? (Trying to select the most recent message from each person and make it link to the conversation)
You have to make use of a temp table which pre sorts your messages by toId and timeSent Then join this temp table to messages For instance, create a table with data CREATE TABLE messages ( messageId integer, idTo integer, idFrom integer, timeSent datetime, content varchar(255) ); insert into messages values (1,11,1,'2013-07-11','first message to user 11'); insert into messages values (2,12,1,'2013-07-03','fist message to user 12'); insert into messages values (3,11,1,'2013-07-12','second message to user 11'); insert into messages values (4,12,1,'2013-07-05','second message to user 12'); insert into messages values (5,13,1,'2013-07-10','second message to user 13'); insert into messages values (6,13,1,'2013-07-09','first message to user 13'); Then query the two joined tables CREATE TE

Categories : PHP

shell script to create backup file when creating new file in particular directory
Can you explain why you want to do? Tools like VIM can create a backup copy of a file you're working on automatically. Other tools like Dropbox (which works on Linux, Windows, and Mac) can version files, so it backs up all the copies of the file for the last 30 days. You could do something by creating aliases to the tools you use for creating these file. You edit a file with the tools you tend to use, and the alias could create a copy before invoking a tool. Otherwise, your choice is to use crontab to occasionally make backups. Addendum let me explain suppose i have directory /home/pavan now i create the file myfile.txt in that directory , immediately now i should automatically generate myfileCopy.txt file in the same folder paven There's no easy user tool that could do that.

Categories : Linux

What do the "drop table" and "create table" options in this backup script do?
So this script is generating a file with all of the SQL commands to recreate the current database. So once the script is done executing you could "import" the file it creates in phpmyadmin and it will drop the tables if they exist and then insert all of the data the was in the tables at the time of the backup. It will not modify anything from the current database For example, this is what the "export" function in phpmyadmin will create for a test table: -- -- Database: `test` -- -- -------------------------------------------------------- -- -- Table structure for table `test_table` -- DROP TABLE IF EXISTS `test_table`; CREATE TABLE IF NOT EXISTS `test_table` ( `id` int(11) NOT NULL, `num` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tes

Categories : PHP

Tablesorter Export to Excel Plugin or Small Script Exist?
Because modern browsers are "sandboxed", you will need some sort of program to do file downloads via purely client-side JavaScript. I use downloadify and find it suits my needs quite well. It's not a true plug-in for tablesorter, but can easily work side-by-side with it.

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.