Monday, September 28, 2015

Sitecore WFFM - Add to Contact List save action not showing contact lists

Environment: Sitecore 8.0 rev 150621

Sometimes when working with the WFFM on Sitecore you might experience the following issue with the 'Add the contact to contact list' save action.


This is because of following:
1. You have no lists created.
2. You have lists but it is not visible in the List Manager.

To ensure this go to the 'List Manager'/


In my case, I have list created but my List Manager won't show me anything.

In this case, go to the Sitecore Control Panel and Select the 'Indexing manager' under the 'Indexing' section.
Select the 'sitecore_list_index' as bellow image.


Then click 'Rebuild'

After it is done, visit the 'List Manager' again. If you have created some list earlier, it must appear in here now as bellow.


Then go to your form's save actions. Select the 'Add to Contact List' save action. Go to Edit.
Then you can see your lists are appear on that save action.



Monday, September 7, 2015

Fixing Sitecore Licence Issue

When working with Sitecore you might face issues like bellow:

At this point your site will not be accessible and you can't run the showconfig.aspx as well.
If you know the location of the data folder (where Sitecore licence live) of your site, you can directly copy the new licence file to that location.

Sitecore default data folder is /App_Data/Sitecore.
But sometimes your website can have a config that override this location for a different location.
In a situation like that we can get the help of Sitecore Config builder. You can download and get to know more about this tool from here.

1. Download the Sitecore COnfig Builder and Unzip to a folder you like.

2. Get the App_Config folder and web.config file of your broken site to a preferred location. Keep the both App_Config folder and web.config file in the same folder.

3. Open Sitecore.ConfigBuilder.Tool.exe 


4. Click on 'Browse' and select the web.config from the location that you have save them.

5. Select 'Save files into the same folder' if you want (this is easier actually ;) ) and click on 'Save'.

6. This will create some couple of files on the location you ask to create.

7. You can find a file called showconfig.xml

8. Open it and find the following section:
<sc.variable name="dataFolder" value="{ Your data folder location }" patch:source="DataFolder.config" />

9. Go to that location. Make sure it has a licence file.

10. Copy your latest Sitecore licence file (copy and replace).

Your site will be now up and running. 

Thursday, September 3, 2015

Working with SItecore MongoDB databases

Sitecore introduce mongoDB on Sitecore 7.5 for handle their Sitecore Experience database (xDB).
When you working with Sitecore mongoDB you have to know how to backup and restore mongoDB databases.

Backup Sitecore mongoDB database

The simple way is to backup as dump.

Go to mongoDB folder/bin from command prompt.
D:\MongoDB\bin>

Backup single database to a different location
D:\MongoDB\bin>mongodump --out \{folder}\{folder}\ -db {database_name}

Ex- D:\MongoDB\bin>mongodump --out E:\backups\ -db mongo_old_db

Sometimes there can be an error like bellow:


Then use D:\MongoDB\bin>mongodump --out \{folder}\{folder}\ --db {database_name}

Read more on mongodump from here

Restore Sitecore mongoDB databse

You can rename the database if you want when restoring.

Go to mongoDB folder/bin from command prompt.
D:\MongoDB\bin>

Restore single database with a different name
D:\MongoDB\bin>mongorestore -d {new_database_name} {old_database_backup_path}

Ex- D:\MongoDB\bin>mongorestore -d mongo_new_db D:\backups\old\mongo_old_db

Read more on mongorestore from here

Read more on other backup and restore methods in mongoDB from here

NOTE: Always use folder paths and folder names without spaces and special characters.
Otherwise use the path within double quotes ("").

To view database tables and data in a graphical way, you can use a tool like RoboMongo.
Read and download RoboMongo from here.