[rt-users] Dump all except tickets+attachments?
Raed El-Hames
Raed.El-Hames at daisygroupplc.com
Thu Jun 23 12:05:06 EDT 2011
Jeff,
If you are in a position to do it via sql , then I would suggest you take this route.
By via sql I mean you are able to do statements like (insert into development_db.Users (select * from production_db.Users) etc ..
If you ignoring Tickets and Attachments I would also ignore the Transactions table content , unless you care about change history for users/groups.
Its also possible to ignore objectcustomfields and objectcustomfieldvalues content unless you are using users/groups/queues custom fields which are not very common.
And also ignore sessions table content
Tables like groups / GroupMembers and CachedGroupMembers are tricky and hard to get right via sql, if you start with the Groups table and select * from Groups where Domain != 'RT::Ticket-Role', then you should be able to do the GroupMembers by select * from production_db.GroupMembers where GroupId in (select Id from development_db.Groups)
As for CachedGroupMembers, its far more tricky and please look into it in more details, but for a starting point I would suggest you do the same select as GroupMembers.
Hope that helps,
Regards;
Roy
>
Visit our website today www.daisygroupplc.com
Registered Office: Daisy House, Lindred Road Business Park, Nelson, Lancashire BB9 5SR
Company Registration Number: 4145329 | VAT Number: 722471355
Daisy Communications Limited is a company registered in England and Wales.
DISCLAIMER
This email (including any attachments) is strictly confidential and may also be legally privileged. If the recipient has received this email in error please notify the sender and do not read, print, re-transmit, store or act in reliance on the email or its attachments and immediately delete this email and its attachments from the recipient's system. Daisy Communications Limited cannot accept liability for any breaches of confidence arising through use of email. Employees of Daisy Communications Limited are expressly required not to make any defamatory statements and not to infringe or authorise any infringement of copyright or any other legal right by email communications. Any such communication is contrary to the company's policy and outside the scope of the employment of the individual concerned. Daisy Communications Limited will not accept any liability in respect of such a communication, and the employee responsible will be personally liable for any damages or other liability arising.
If you are the intended recipient of this email please ensure that neither the email nor any attachments are copied to third parties outside your organisation or saved without the written permission of the sender. In the event of any unauthorised copying or forwarding, the recipient will be required to indemnify Daisy Communications Limited against any claim for loss or damage caused by any viruses or otherwise.
WARNING: Computer viruses can be transmitted by email. The recipient should check this email and any attachments for the presence of viruses. Daisy Communications Limited accepts no liability for any damage caused by any virus transmitted by this email or any attachments.
NOTICE TO CUSTOMERS
If you have ordered a telephone number from Daisy Communications Limited (non-geographic or new line installation) please do NOT arrange for any form of advertising until the number is live and tested.
-----Original Message-----
> From: rt-users-bounces at lists.bestpractical.com [mailto:rt-users-
> bounces at lists.bestpractical.com] On Behalf Of Jeff Blaine
> Sent: 23 June 2011 16:33
> To: rt-users at lists.bestpractical.com
> Subject: [rt-users] Dump all except tickets+attachments?
>
> If anyone has any clever advice as to how to about this,
> I'd love to hear it.
>
> RT 3.8.7 + security patches, PostgreSQL 8.1.23, RHEL5
>
> We need to replicate our production RT instance's data
> to a development instance (yes, backward), but we don't
> want to carry the ~6GB of *ticket and attachment*
> data (what else?) over to development.
>
> Essentially, we want the same environment in development
> as production, but with empty queues.
>
> Advice?
>
> You are now connected to database "rt3".
> rt3=# \dt
> List of relations
> Schema | Name | Type | Owner
> --------+-------------------------+-------+----------
> public | acl | table | postgres
> public | attachments | table | postgres
> public | attributes | table | postgres
> public | cachedgroupmembers | table | postgres
> public | customfields | table | postgres
> public | customfieldvalues | table | postgres
> public | fm_articles | table | rt_user
> public | fm_classes | table | rt_user
> public | fm_objecttopics | table | rt_user
> public | fm_topics | table | rt_user
> public | groupmembers | table | postgres
> public | groups | table | postgres
> public | links | table | postgres
> public | objectcustomfields | table | postgres
> public | objectcustomfieldvalues | table | postgres
> public | principals | table | postgres
> public | queues | table | postgres
> public | scripactions | table | postgres
> public | scripconditions | table | postgres
> public | scrips | table | postgres
> public | sessions | table | postgres
> public | templates | table | postgres
> public | tickets | table | postgres
> public | transactions | table | postgres
> public | users | table | postgres
> (25 rows)
>
> --------
> 2011 Training: http://bestpractical.com/services/training.html
More information about the rt-users
mailing list