Multitenant System

167 views
Skip to first unread message

saurabh palande

unread,
Mar 7, 2014, 1:04:00 AM3/7/14
to erpnext-dev...@googlegroups.com
Hi,

I want to know, how I can achieve Multitenancy in ERPNext? I have create fresh database and conf file manually, but not getting how to map tenant to there respective database.

Regards,
Saurabh




Saurabh Palande

unread,
Mar 8, 2014, 3:05:54 AM3/8/14
to erpnext-dev...@googlegroups.com
Hi,

How can I create Multitenant System for ERPNext?


Regards,
Saurabh

Pratik Vyas

unread,
Mar 8, 2014, 3:07:48 AM3/8/14
to erpnext-dev...@googlegroups.com
Hi Saurabh,

On Sat, Mar 8, 2014 at 1:35 PM, Saurabh Palande <saura...@gmail.com> wrote:
> Hi,
>
> How can I create Multitenant System for ERPNext?
>

Yes you can. I'll create a wiki page (for version 3) and reply in
sometime. Version 4 is multitenant out of the box.

>
> Regards,
> Saurabh
>
> --
> Note:
>
> If you are posting an issue,
> 1. We should be able to replicate it at our end. So please give us as much
> information as you can. Please see it from the point of view of the person
> receiving the communication.
> 2. Paste your code at http://pastebin.com or http://gist.github.com and send
> only the URL via email
> 3. For sending images, use http://imgur.com or other similar services. Do
> not send images as attachments. Links are good. Same goes for any file you
> are going to send.
>
> End of Note
> ---
> You received this message because you are subscribed to the Google Groups
> "ERPNext Developer Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to erpnext-developer...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/erpnext-developer-forum/CAGCrPP-GgkyJaVfCEuTTwHs8M3FRo5YgbfbihX9--SsagemaOw%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.


Thanks,
--
Pratik
erpnext

Pratik Vyas

unread,
Mar 8, 2014, 12:43:59 PM3/8/14
to erpnext-dev...@googlegroups.com
Hi Saurabh,

On Sat, Mar 8, 2014 at 1:35 PM, Saurabh Palande <saura...@gmail.com> wrote:
> Hi,
>
> How can I create Multitenant System for ERPNext?
>
Can you try to follow this,
https://github.com/webnotes/erpnext/wiki/Setup-Multitenancy-for-ERPNext-3

Post any errors you get.


Thanks
--
Pratik
erpnext

Saurabh Palande

unread,
Mar 10, 2014, 2:57:25 AM3/10/14
to erpnext-dev...@googlegroups.com
Hi Pratik,

Thank you,

I have followed steps as ,

1. Install ERPNext and change to erpnext directory: i have installed erpnext at :-- /home/indictrans/erpnext/erpnext then cd .. now I am at /home/indictrans/erpnext

2. create sites directory: created sites directory at :-- /home/indictrans/erpnext/sites

3. Add sites_dir to conf.py : added sites_dir to conf file at:-- /home/indictrans/erpnext/erpnext/conf.py

4. Move the existing site to sites directory : mkdir -p sites/test_erp/  then  mv /home/indictrans/erpnext/erpnext/public sites/test_erp/public

5. make site_config.json :  edit sites/test_erp/site_config.json but got error saying Error: no "edit" mailcap rules found for type "application/json",  so I have create it using VIM command and added the mentioned content as it is.

6. Then moved to path /home/indictrans/erpnext/erpnext and executed ./lib/wnf.py --install test2 -- test_erp for new setup but stuck with error wnf.py: error: unrecognized arguments: -- site_name





--
Note:

If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
S.S.Palande

Pratik Vyas

unread,
Mar 10, 2014, 3:28:39 AM3/10/14
to erpnext-dev...@googlegroups.com
Hi Saurabh,

On Mon, Mar 10, 2014 at 12:27 PM, Saurabh Palande <saura...@gmail.com> wrote:
> Hi Pratik,
>
> Thank you,
>
> I have followed steps as ,
>
> 1. Install ERPNext and change to erpnext directory: i have installed erpnext
> at :-- /home/indictrans/erpnext/erpnext then cd .. now I am at
> /home/indictrans/erpnext
>
> 2. create sites directory: created sites directory at :--
> /home/indictrans/erpnext/sites
>
> 3. Add sites_dir to conf.py : added sites_dir to conf file at:--
> /home/indictrans/erpnext/erpnext/conf.py
>
> 4. Move the existing site to sites directory : mkdir -p sites/test_erp/
> then mv /home/indictrans/erpnext/erpnext/public sites/test_erp/public
>
> 5. make site_config.json : edit sites/test_erp/site_config.json but got
> error saying Error: no "edit" mailcap rules found for type
> "application/json", so I have create it using VIM command and added the
> mentioned content as it is.
>

Sorry, it can be confused with the Autotools make, changed the word to write.

> 6. Then moved to path /home/indictrans/erpnext/erpnext and executed
> ./lib/wnf.py --install test2 -- test_erp for new setup but stuck with error
> wnf.py: error: unrecognized arguments: -- site_name

it was a typo, should be "--site site_name"
>
>


Thanks,
--
Pratik
erpnext

Saurabh Palande

unread,
Mar 10, 2014, 5:22:09 AM3/10/14
to erpnext-dev...@googlegroups.com
Hi Pratik,

I have used write sites/test_erp/site_config.json but getting error saying write: sites/test_erp/site_config.json is not logged in
so again I create it using vim sites/test_erp/site_config.json. 

Then I run  ./lib/wnf.py --install test --site test_erp command but getting following error,
Trace-back is: 
gangadhar@gangadhar-System-Product-Name:/home/erpnext/erpnext$ ./lib/wnf.py --install test4 --site test_erp
MySQL root password: 
Created user test
Created database test
Granted privileges to user test and database test
Starting database import...
Imported from database lib/webnotes/../conf/Framework.sql
Installing app...
Traceback (most recent call last):
  File "./lib/wnf.py", line 803, in <module>
    main()
  File "./lib/wnf.py", line 23, in main
    run(fn, parsed_args)
  File "./lib/wnf.py", line 41, in run
    out = globals().get(fn)(*args.get(fn), **args)
  File "./lib/wnf.py", line 34, in new_fn
    return fn(*args, **new_kwargs)
  File "./lib/wnf.py", line 224, in install
    inst.install(db_name, source_sql=source_sql, verbose=verbose, force=force, admin_password=admin_password)
  File "lib/webnotes/install_lib/install.py", line 88, in install
    self.install_app(verbose=verbose)
  File "lib/webnotes/install_lib/install.py", line 104, in install_app
    sync_for("lib", force=True, sync_everything=True, verbose=verbose)
  File "lib/webnotes/model/sync.py", line 20, in sync_for
    return walk_and_sync(get_path(folder), force, sync_everything, verbose=verbose)
  File "lib/webnotes/model/sync.py", line 45, in walk_and_sync
    if import_file(module_name, doctype, name, force=force) and verbose:
  File "lib/webnotes/modules/import_file.py", line 30, in import_file
    ret = import_file_by_path(path, force)
  File "lib/webnotes/modules/import_file.py", line 51, in import_file_by_path
    import_doclist(doclist)
  File "lib/webnotes/modules/import_file.py", line 101, in import_doclist
    new_bean.insert()
  File "lib/webnotes/model/bean.py", line 260, in insert
    return self.save()
  File "lib/webnotes/model/bean.py", line 297, in save
    self.prepare_for_save("save")
  File "lib/webnotes/model/bean.py", line 197, in prepare_for_save
    self.update_timestamps_and_docstatus()
  File "lib/webnotes/model/bean.py", line 179, in update_timestamps_and_docstatus
    ts = now()
  File "lib/webnotes/utils/__init__.py", line 206, in now
    return now_datetime().strftime('%Y-%m-%d %H:%M:%S')
  File "lib/webnotes/utils/__init__.py", line 179, in now_datetime
    return convert_utc_to_user_timezone(datetime.utcnow())
  File "lib/webnotes/utils/__init__.py", line 196, in convert_utc_to_user_timezone
    return utcnow.astimezone(timezone(get_user_time_zone()))
  File "lib/webnotes/utils/__init__.py", line 183, in get_user_time_zone
    webnotes.local.user_time_zone = webnotes.cache().get_value("time_zone")
  File "lib/webnotes/memc.py", line 20, in get_value
    val = self.get(self.n(key))
  File "/usr/local/lib/python2.7/dist-packages/memcache.py", line 898, in get
    return self._get('get', key)
  File "/usr/local/lib/python2.7/dist-packages/memcache.py", line 847, in _get
    self.check_key(key)
  File "/usr/local/lib/python2.7/dist-packages/memcache.py", line 1062, in check_key
    "Control characters not allowed")
memcache.MemcachedKeyCharacterError: Control characters not allowed





--
Pratik
erpnext

--
Note:

If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
S.S.Palande

Saurabh Palande

unread,
Mar 10, 2014, 7:16:26 AM3/10/14
to erpnext-dev...@googlegroups.com
Hi Pratik,

Thank You for the help. Issue is resolved now. 

Regards,
--
S.S.Palande

Anand Doshi

unread,
Mar 10, 2014, 12:59:28 PM3/10/14
to ERPNext Developer's Forum
Hi Saurabh.

What is the db_name value in site_config.json? It seems to have some characters that memcache dislikes.

-Anand.


Saurabh Palande

unread,
Mar 12, 2014, 7:33:58 AM3/12/14
to erpnext-dev...@googlegroups.com
Hi Anand,

Thank You. Its working fine now. I have one more doubt how I can enable or disable particular tenant account in ERPNext? 

Regards,



For more options, visit https://groups.google.com/d/optout.



--
S.S.Palande

Saurabh Palande

unread,
Mar 13, 2014, 12:02:12 PM3/13/14
to erpnext-dev...@googlegroups.com
Hi,

How I can enable or disable particular tenant account?

Regards,
--
S.S.Palande

Pratik Vyas

unread,
Mar 13, 2014, 12:05:22 PM3/13/14
to erpnext-dev...@googlegroups.com

Just remove it from the sites directory.

sent from phone

Reply all
Reply to author
Forward
0 new messages