Hello,
I need to manually insert data back into table dynamic_field_value which was deleted when I archived some tickets:
INSERT into dynamic_field_value (id,field_id,object_id,value_text) values( ,'27','5439','Test')
Can someone advise how I can populate ID column with next available value.
Thanks, Ben
Manual insert data into a table
Moderator: crythias
-
- Administrator
- Posts: 4253
- Joined: 18 Dec 2007, 12:23
- Znuny Version: Znuny and Znuny LTS
- Real Name: Roy Kaldung
- Company: Znuny
- Contact:
Re: Manual insert data into a table
There is no need to insert data direct into the table. Use XML-RPC (deprecated), GenericInterface (SOAP/REST) or the Perl API. Never ignore the provided APIs.
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO
Use a test system - always.
Do you need professional services? Check out https://www.znuny.com/
Do you want to contribute or want to know where it goes ?
Use a test system - always.
Do you need professional services? Check out https://www.znuny.com/
Do you want to contribute or want to know where it goes ?
Re: Manual insert data into a table
Is there a way to do it from DB as I am more familiar with SQL than webservice
-
- Administrator
- Posts: 4253
- Joined: 18 Dec 2007, 12:23
- Znuny Version: Znuny and Znuny LTS
- Real Name: Roy Kaldung
- Company: Znuny
- Contact:
Re: Manual insert data into a table
I can't recommend bypassing the API. What's your exactly use case?benjamin1 wrote:Is there a way to do it from DB as I am more familiar with SQL than webservice
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO
Use a test system - always.
Do you need professional services? Check out https://www.znuny.com/
Do you want to contribute or want to know where it goes ?
Use a test system - always.
Do you need professional services? Check out https://www.znuny.com/
Do you want to contribute or want to know where it goes ?
Re: Manual insert data into a table
Data loss occurred due to use of a 3rd party plugin (DynamicFieldRemoteDB), when we archived tickets the dynamic field value populated using this plugin was lost.
We have extracted lost data from ticket_history table.
We now need to insert data back into dynamic_field_value table
e.g.
INSERT into dynamic_field_value (id,field_id,object_id,value_text) values( ,'27','5439','Test')
We have extracted lost data from ticket_history table.
We now need to insert data back into dynamic_field_value table
e.g.
INSERT into dynamic_field_value (id,field_id,object_id,value_text) values( ,'27','5439','Test')
-
- Administrator
- Posts: 4253
- Joined: 18 Dec 2007, 12:23
- Znuny Version: Znuny and Znuny LTS
- Real Name: Roy Kaldung
- Company: Znuny
- Contact:
Re: Manual insert data into a table
That's the first time that I heard this about this add on. And I guess it has nothing to do with the data loss, because the values are stored in the same table. The addon is used when entering new data and displaying the data. :-/benjamin1 wrote:Data loss occurred due to use of a 3rd party plugin (DynamicFieldRemoteDB), when we archived tickets the dynamic field value populated using this plugin was lost.
For a one time job you can try this, but be sure to delete all caches after this.benjamin1 wrote: We now need to insert data back into dynamic_field_value table
e.g.
INSERT into dynamic_field_value (id,field_id,object_id,value_text) values( ,'27','5439','Test')
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO
Use a test system - always.
Do you need professional services? Check out https://www.znuny.com/
Do you want to contribute or want to know where it goes ?
Use a test system - always.
Do you need professional services? Check out https://www.znuny.com/
Do you want to contribute or want to know where it goes ?