Perfex CRM to SAAS Module

Fastest way to convert your Perfex CRM to Software as a service without breaking sweat or perfex updates.

turnCRM is a multicompany software as server (SAAS) module for perfex CRM. The module convert your simple perfex CRM installation into SAAS without loosing data or breaking future update from perfex CRM. Agency can register and signup for subscription on your platform and create many crm (limit by plan set by you) as possible for numbers of company. It comes with clean, secured, responsive, SEO friendly & eye-catching design which will attract your future customer with the first impression. Below image give perfect illustration of what turnCRM does.

There are various mechanisms to secure application. These mechanisms are:

TurnCRM will work on any hosting that support your current Perfex CRM installation. Thus this module require you to have installed and setup Perfex CRM. Weve tested this module to work perfectly with PHP 7+ make sure you have lestest PHP version.

For custom domain and subdomain to work properly, you need to configure wildcard subdomain on your domain and CNAME for custom domain. See Limitations


NOTE: Single DB single tenant option schema option requires database user with root priviledge.

The installation is simple as abc, follow below step:

After activation, refresh the current page, and you will be redirected to installer wizard to finish the installation. If not, click on 'setup' link close to the menu. The wizard is dead simple with full instruction.

Ensure folders permission are all set

I will give illustration to guide selection of database(DB) scheme in step 3 of installation. Choose according to your hosting and wish. All the scheme could be backed up with our backup management.

  1. MultiTenant Single DB - allow you to put all tenant in single current database. This is best option for shared hosting plans such as cpanel.

  2. MultiTenant Multiple DB - Sharding allow you to have pool of databases to use instead of single db, you can split client accross numbers of database. We automatically select fittest DB when creating tenant, you can move tenant from on DB to another. This is a good option if you dont have root priviledge. This will work on cpanel or any shared hosting

  3. Single Tenant Per DB - requires your current database user to have priviledge to create another database. This wont likely work on share hosting plan and it might require dedicated server or DB user with root priviledge. This save each tenant data in a separate Database

After selecting DB scheme, kindly setup your saas admin account. This acocunt will be default login for accessing SAAS admin dashboard.

After installation, Click on setup link beside module to finish installation and create login credential for SAAS.

After then, you need to do following settings:

  1. Go to SAAS login and Login with your credential
  2. Go to Settings > General to configure Logo, theming, Admin email e.t.c for notification and setup email smtp credentials
  3. Go to payment settings (Settings > Payment) and provide your stripe credentials.
  4. Go to Settings > Pricing Package to setup subscription plans.
  5. You are good to go

The UI design is straight forward and you can make management of content easily.

However i will be explaining most of usage outline in this section.


✓  Manage Website Settings: If you want to add your site name, email, phone, about, designation, logo, favicon, basic seo options, social links, themes you need to go "Dashboard > Settings > General Settings" section from left sidebar. you can manage all options here.

✓  Manage users: If you want to manage registered users you need to go "Dashboard > Users" section from left sidebar. you can manage all users here.

✓  Manage Site Service: If you want to manage your site service you need to go "Dashboard > CMS > Service" section from left sidebar. you can manage all option here.

✓  Setup Payment: If you want to manage payment gateway you need to go "Dashboard > Settings > Payment Settings " section from left sidebar. you can manage stripe keys here. Make sure you provide your webhook secret after submiting your secret and public keys.

✓  Manage Package: If you want to manage site Package & Plan you need to go "Dashboard > Settings > Pricing Package" section from left sidebar. you can manage all pricing here.

✓  Manage Testimonial: If you want to manage your Testimonial you will see from left sidebar "CMS > Testimonial" menu and here you will see this manage options when you click. And you can manage Testimonial CRUD in an one pages.

✓  Manage Blog: If you want to add Blog first you need add Blog Category to go "CMS > Blog" section from left sidebar navigation and click on the "Add Category" options then you can add Category here in one page CRUD. And then Clink "Blog" section from left sidebar navigation to add "Blog".

✓  Manage Contacts: If you want to see/manage your Contacts you will see from left sidebar "Contacts" menu and here you will see this manage options when you click.


✓  Manage Company/Instances: If you want to add Company or deploy new CRM instance, you will see from left sidebar "Company" menu and here you will be able to manage instances/companies when you click.

When creating a company you have to provide a slug that will used as as subdomain. i.e f your installation domain is turnsaas.com and you provide a slug 'company1' you CRM instance will be accessible from company1.turnsaas.com.

To use custom domain i.e www.company1.com , you need to provide a domain in the domain input box. Then go to your domain panel (where you manage your domain) and CNAME this domain to company1.turnsaas.com (or whatever your slug and domain is).


I will be disussing most important technical logic here.

Managing Database Shard

If you have selected shard database scheme (multitenant multiple database) in your installation or settings, you can add unlimited numbers of database to your pool. When a company/crm instance is created, we select less dense db among the pool for the instance.

To manage db pool;

All the database will wrong connection will be reported and only succesful ones will be stored (as shard pool).

Now when customer create a company (crm instance) one of these database will be selected.



Reserved Slugs

During company registration, you can prevent any company from having a slug as subdomain such as admin. You can manage all this in 'Settings > General Settings > Saas Settings (tab)'. Provide reserved slug that wont be availabe for user by any user.

Protect your backup files and import modules files.

We have developed this module with data protection and optimum security mind set.

To ensure your backup files and some other static files are not accessible through http, Kindly implement following practice in accordance to your server specification

For apache server, create .htaccess in uploads/saas/backup and modules/saas/storage and insert following code;

		Order deny,allow
		Deny from all

For nginx server, create .htaccess in uploads/saas/backup and insert following code;

		location ~ /(uploads/saas/backup|modules/saas/storage)
		     deny all;
		     return 403;

How to prevent direct https access to important files like backup

Refer to 'Technical Know How' section

Error 404 after activating saas module

If you see 404 in normal pages after you activate saas, this tells you SAAS is active, thus you can access old/default CRM from app.yourcrmdomain.com

Will user access modules not activated my default app ?

Yes all module assigned by admin and those on tenant plan will be availabe for the tenant

How to connect domain ?

We dont register custom domains automatically on the fly

Custom Domain and Subdomain.

We dont register custom domains automatically on the fly to your dns server (as it vary with different host), you are expected to find way around this by setting up wildcard subdomain and CNAME on you server if this is possible. Or contact us to develop this for you at very affordable rate.

Uninstall the module is quite easy but could be fatal is not intented.

Make sure you backup all company data and files before attempting uninstall. Uninstalling the saas module will restore your system to how it was before you install; all the crm instances data and backup files will be deleted. Only dafault data app will remain, and you can continue using your CRM just as before.

To uninstall, follow this step;

Version 0.1 (15/01/2021)

Initial Release

This script uses the following libraries and assets:


I spent a lot of time on this awesome module. Nevertheless it's still not finished. I like to improve it wherever I can and appreciate your feedback.

Best wishes


https://turncrm.turnsaas.com mail@turnsaas.com