Talk:FoolFuuka: Difference between revisions

From Bibliotheca Anonoma
(Created page with "<pre> mysqlchump --table 'a,b,c,etc' --connectionString "Server=127.0.0.1;Database=asagi;User Id=backup;Password=backuppassword;" --select 'SELECT `doc_id`, `media_id`, `num`,...")
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<pre>
<pre>
mysqlchump --table 'a,b,c,etc' --connectionString "Server=127.0.0.1;Database=asagi;User Id=backup;Password=backuppassword;" --select 'SELECT `doc_id`, `media_id`, `num`, `subnum`, `thread_num`, `op`, `timestamp`, `timestamp_expired`, `preview_orig`, `preview_w`, `preview_h`, `media_filename`, `media_w`, `media_h`, `media_size`, `media_hash`, `media_orig`, `spoiler`, `deleted`, `capcode`, `email`, `name`, `trip`, `title`, `comment`, `sticky`, `locked`, `poster_hash`, `poster_country`, `exif` FROM `a` ORDER BY `doc_id` WHERE timestamp > 1574341200 AND timestamp < 1574514000 ASC ' a.sql
mysqlchump --table 'a,b,c,etc' --connectionString "Server=127.0.0.1;Database=asagi;User Id=asagi;Password=YOUR_PASSWORD_HERE;" --select 'SELECT `doc_id`, `media_id`, `num`, `subnum`, `thread_num`, `op`, `timestamp`, `timestamp_expired`, `preview_orig`, `preview_w`, `preview_h`, `media_filename`, `media_w`, `media_h`, `media_size`, `media_hash`, `media_orig`, `spoiler`, `deleted`, `capcode`, `email`, `name`, `trip`, `title`, `comment`, `sticky`, `locked`, `poster_hash`, `poster_country`, `exif` FROM `a` ORDER BY `doc_id` WHERE timestamp > 1574341200 AND timestamp < 1574514000 ASC ' a.sql
</pre>
</pre>


Line 12: Line 12:


what you do is specify the tables you want to dump, and then a templated select query
what you do is specify the tables you want to dump, and then a templated select query
so instead of specifying <pre>FROM `g`</pre> in the query for example, you specify <pre>FROM `{board}`</pre>
 
so instead of specifying <pre>FROM `g`</pre> in the query for example, you specify <pre>FROM `{table}`</pre>
m
m
and the specific where query i need dumped (of all boards) is WHERE timestamp > 1574341200 AND timestamp < 1574514000
 
and the specific where query i need dumped (of all boards) is <pre>WHERE timestamp > 1574341200 AND timestamp < 1574514000</pre> (remove to dump all)
 
<pre>
mkdir dump-20191202 # create the folder to dump into
./mysqlchump --tables '3,a,aco,adv,an,asp,b,bant,biz,c,cgl,ck,cm,co,d,diy,e,f,fa,fit,g,gd,gif,h,hc,his,hm,hr,i,ic,int,jp,k,lgbt,lit,m,mlp,mu,n,news,o,out,p,po,pol,qa,qst,r,r9k,s,s4s,sci,soc,sp,t,tg,toy,trash,trv,tv,u,v,vg,vip,vp,vr,w,wg,wsg,wsr,x,y' --connectionString "Server=127.0.0.1;Database=asagi;User Id=asagi;Password=YOUR_PASSWORD_HERE;" --select 'SELECT `doc_id`, `media_id`, `num`, `subnum`, `thread_num`, `op`, `timestamp`, `timestamp_expired`, `preview_orig`, `preview_w`, `preview_h`, `media_filename`, `media_w`, `media_h`, `media_size`, `media_hash`, `media_orig`, `spoiler`, `deleted`, `capcode`, `email`, `name`, `trip`, `title`, `comment`, `sticky`, `locked`, `poster_hash`, `poster_country`, `exif` FROM `{table}` ORDER BY `doc_id` WHERE timestamp > 1574341200 AND timestamp < 1574514000 ASC ' dump-20191202
</pre>

Latest revision as of 05:18, 3 December 2019

mysqlchump --table 'a,b,c,etc' --connectionString "Server=127.0.0.1;Database=asagi;User Id=asagi;Password=YOUR_PASSWORD_HERE;" --select 'SELECT `doc_id`, `media_id`, `num`, `subnum`, `thread_num`, `op`, `timestamp`, `timestamp_expired`, `preview_orig`, `preview_w`, `preview_h`, `media_filename`, `media_w`, `media_h`, `media_size`, `media_hash`, `media_orig`, `spoiler`, `deleted`, `capcode`, `email`, `name`, `trip`, `title`, `comment`, `sticky`, `locked`, `poster_hash`, `poster_country`, `exif` FROM `a` ORDER BY `doc_id` WHERE timestamp > 1574341200 AND timestamp < 1574514000 ASC ' a.sql

here is your updated version of mysqlchump with multi-table dumping support i'd add a github release but i'm about to pass out alongside the original syntax for single tables, there is now a different argument list for multi table dumps

mysqlchump --tables <comma separated table names> --connectionString <connection string> [--select <select sql statement>] [<output folder>]

what you do is specify the tables you want to dump, and then a templated select query

so instead of specifying

FROM `g`

in the query for example, you specify

FROM `{table}`

m

and the specific where query i need dumped (of all boards) is

WHERE timestamp > 1574341200 AND timestamp < 1574514000

(remove to dump all)

mkdir dump-20191202 # create the folder to dump into
./mysqlchump --tables '3,a,aco,adv,an,asp,b,bant,biz,c,cgl,ck,cm,co,d,diy,e,f,fa,fit,g,gd,gif,h,hc,his,hm,hr,i,ic,int,jp,k,lgbt,lit,m,mlp,mu,n,news,o,out,p,po,pol,qa,qst,r,r9k,s,s4s,sci,soc,sp,t,tg,toy,trash,trv,tv,u,v,vg,vip,vp,vr,w,wg,wsg,wsr,x,y' --connectionString "Server=127.0.0.1;Database=asagi;User Id=asagi;Password=YOUR_PASSWORD_HERE;" --select 'SELECT `doc_id`, `media_id`, `num`, `subnum`, `thread_num`, `op`, `timestamp`, `timestamp_expired`, `preview_orig`, `preview_w`, `preview_h`, `media_filename`, `media_w`, `media_h`, `media_size`, `media_hash`, `media_orig`, `spoiler`, `deleted`, `capcode`, `email`, `name`, `trip`, `title`, `comment`, `sticky`, `locked`, `poster_hash`, `poster_country`, `exif` FROM `{table}` ORDER BY `doc_id` WHERE timestamp > 1574341200 AND timestamp < 1574514000 ASC ' dump-20191202