Migrate your Freshdesk users, tickets and conversations / comments to Zendesk.
Before migrating tickets you need to set up the environment and install the necessary packages.
Follow this link to install Ruby on your system. The version of Ruby used during development was 2.7.1, to use other versions of ruby you may need to update the Gemfile.
MySQL is used as a relational database management system, which is used to store tickets locally for successful ticket migration, monitoring progress, and post-migration verification.
After installation of Ruby and MySQL, run the below command to install the requirements.
bundle install
Open fd2zd.rb
file and update the configurations. For Freshdesk you will need to update the following configurations:
subdomain
- Subdomain of Freshdesk accountapi_token
- Your Freshdesk API Keyinclude_conversations
- Import conversations of each ticket as wellfilter
- Define criteria to migrate only required ticketstickets_updated_since
- This should be set to any date which is older than your Freshdesk account creation date
For Zendesk, update the following configurations:
subdomain
- Subdomain of your Zendesk accountapi_token
- API Token created in your Zendesk accountadmin_email
- Admin Email of Zendesk account.jobs_count
- Number of Import Jobs to start in parallel to speed up the process.
For Database you will need to update these configurations:
adapter
- Database adapterencoding
- Character Set Encodingusername
- Database Usernamepassword
- Database Passworddatabase
- Database Name
Before migration, you should set up Zendesk account for migration.
- Disable the welcome email notification for new end users.
- Create a sandbox instance to test the migration.
Run the command below to create and set up a database.
bundle exec rake db:prepare
After the database is prepared, we can load tickets in the database.
bundle exec rake fd2zd:load_tickets
Load agents in the database as well:
bundle exec rake fd2zd:load_resources CLASS=Agent
To load contacts in the database you have two options
- Load all contacts
- Load only required contacts (having tickets that will be migrated to Zendesk)
To load all contacts:
bundle exec rake fd2zd:load_resources CLASS=Contact
To load only required contacts:
bundle exec rake fd2zd:load_required_contacts
Once you have required users in the database, you can import them into your Zendesk account. A user is only imported if it doesn't already exist in Zendesk.
Before migrating users, you may want to customize the mapping of the fields. To do so, open the file lib/converters/user_converter.rb
. The UserConverter
class can be changed to customize the migration of users.
Run the command below to import users.
bundle exec rake fd2zd:import_users
If the number of users to import is large, you may want to monitor the progress. Open a new terminal tab and run this command to monitor progress.
bundle exec rake fd2zd:users_import_job_status
After completion of the users import job, you can verify the migration by running this command:
bundle exec rake fd2zd:verify_users_import
After you have imported all required users from your Freshdesk account to Zendesk, you are ready to import tickets.
Like UserConverter
, the TicketConverter
class converts Freshdesk ticket into Zendesk ticket. The class is defined in file lib/converters/ticket_converter.rb
. You can customize this class to control the mapping of the fields.
Important: In lib/converters/ticket_converter.rb
file, enter default values for assignee_id
, requester_id
, author_id
, otherwise your tickets will not be imported if your Freshdesk agent / customer does not exist in Zendesk.
Once the TicketConverter
class is ready, you can run the below command to start migration.
Note: The tickets imported will be archived immediately, ticket status is set to 'closed' by default (can be changed in TicketConverter
class) and 'freshdesk-import'
tag is added to each ticket.
bundle exec rake fd2zd:import_tickets
To monitor progress of tickets import, you can run this command in a new terminal:
bundle exec rake fd2zd:tickets_import_job_status
To verify the tickets import, after the import job is completed, run this command:
bundle exec rake fd2zd:verify_tickets_import
To customize the import job further, you can edit the lib/zendesk/tickets_import_service.rb
file.