How do I clean xDB in Sitecore? - sitecore

Have recently tried working with xDB in Sitecore 8 and now looking for the way of cleaning out current stats from xDB without re-installing Sitecore. I deleted data files for Mongo (as was suggested) but still see figures in Analytics in Sitecore; also did iisreset but also did not help. What am I doing wrong? (I am new to Sitecore so might be missing something).

Have you tried to clean-up only MongoDB files, without Reporting database?
If yes, I think that is a point of your confusion. The way it works in xDB is that all tracking analytics data is written into Mongo and then by SessionEnd processed and saved into Reporting database, that is SQL database, same way as it was before previously in DMS. In that case you need to clean that database as well.
If you have access to SQL, you may use __DeleteAllReportingData stored procedure as the quickest:
More correct approach that goes well for instances where there is no direct access to DB is using admin tool for that located at /sitecore/admin/RebuildReportingDB.aspx. Also there was a module Analytics Database Manager previously, however I do not know its current state.
Reference: Walkthrough: Rebuilding the reporting database (from official documentation)

Related

How can I make a SQL application work offline?

I'm making a c++/Qt application. It connects to a small online database to find different information. I need to make sure that the application works offline. So I would like to do the following
On start up of application:
- Check if internet connection is available
- if available connect to online database, download database to local (for next time no internet is available)
- if not available connect to the kocally stored version of the database
My problem is I can't find a simple solution how to "download" the database. The user will not update the database, so there is no need for syncing when online again, just the ability to download the newest version of the database, whenever online. It is a MS SQL server that the application uses.
My only idea for a solution is to have an SQLite db in the application, and then write a script that clears the SQLite database and then puts everything from the online server into it, but this requires that I write a script that goes through all of the databse. There must be a better solution. I'm also not sure how this solution should work if the database structure changes. A solution for this could just be to send out a update for the application if the structure changes with a new SQLite db with the new structure.
I tried searching for a solution, but I could not find anything that are simple. Since I don't neew syncing back and forth, I thought there must be a simple solution. Any help pointing me in the right direction is appreciated.

Zend Framework 2 and Doctrine change database per module

I have an application which use Zend Framework and Doctrine.
I want to change for a module the database from the default settings.
I have created an alternative connection for doctrine.
When creating/updating the tables using,
./vendor/bin/doctrine-module orm:schema-tool:update --force
the tables are created in the first configuration of database.
Basically what I want to update the second configured database tables.
Can someone help me with an working example ?
Thanks,
Bogdan
To my knowledge, the schema-tool binary only works with the orm_default database.
Now, there's certainly nothing stopping you from having modules that add additional named connections. See this documentation for doing that:
https://github.com/doctrine/DoctrineORMModule/blob/master/docs/configuration.md#how-to-use-two-connections
But, the tooling around managing those additional databases might be a little "roll your own". The good news is all the pieces are there (Doctrine's underlying SchemaTool classes), you would just need to wire them up and build a cli command that acts on multiple schemas.
All that being said, if you find yourself using multiple unique schemas in the same database engine (unique being the key word to account for things like doctrine sharding), I worry your application design might be potentially troublesome. It could be possible that your multiple storage domains should actually live as separate applications.

sitecore is failing to publish language versions to web database

We have upgraded Sitecore to 7.1, but we are experiencing a problem with publishing.
We create a new item in the master database in English, then we publish this item, switch to the web database to check if it's there, which it is, however... The item does not have a version! Therefore the item is not displaying on the website.
Any ideas as to what could be causing this?
Thanks.
I was having the same issue with Sitecore 8+ where i was able to add language specific content but couldn't publish it. Figured out how to resolve it
1) First Language needs to be registered in \sitecore\system\languages by defining the language to be use.
2) Publish these language items first before publishing content else the behavior will be the same.
3) After publishing languages, then publish the content. In the publish window you will see the language under "Publishing language" section and select the language to publish the content.
Make sure that parent items have a version as well and are also in final state if they are part of a workflow.
I had problems with publishing because I didn't have a language version in one of my parents. In my case it was a parent folder under the content node.
Hope it helps.
Al
Please try republishing your entire site. In some cases, a part of the tree hierarchy might be missing in the Web DB, due to which, publishing the child nodes wouldnt work. Republishing the site can eliminate this chance.
This has been resolved.
It turns out that the SQL server did not have enough space for a full publish. A full publish had been attempted and failed due to the lack of space on the SQL server. subsequently this had corrupted the database.
We had to restore an earlier version of the database and ensure the SQL server had plenty of space for the full publish to finish.
I ran into this issue earlier with my Sitecore 7.2 upgrade. The key here is to ensure the items, templates and layouts (associated with the item) all has appropriate language+versions in master db. In my case, we were also using Partial Language fallback and needed to make that was working proper as well.
Once you identify the item (with missing versions), add them and republish the whole item. For few template types I noticed Sitecore was still not publishing properly. Ex: Items based off Sublayout Folder template. The fix was easy in this case as I changed the template type to Folder and republished.
Also switch to web database in sitecore client and ensure you are able to preview the item (from web db)
Hope this helps.

Guvnor seems to copy assets across External RDBMS and file system

I set up SQL Server as the external repository, and left everything else in guvnor and jboss AS7 configured pretty much according to defaults.
When I create assets in guvnor, I see that changes are being made in the MSSQL db. Despite changes to the db, however, I'm still seeing changes to the Repository and Workspace folders. It gets more interesting when I truncate the tables in the external guvnor db, and restart guvnor, it seems to get all of its assets back from those two folders.
Am I doing something wrong? Is it reconstructing the assets from lucene indexes? If MSSQL is already indexing things, is the lucene index still necessary? Are these basic JCR concepts that I am not grasping?
Thanks,
Yuri
This questions was answered on the Drools forum:
http://drools.46999.n3.nabble.com/rules-users-Guvnor-seems-to-copy-assets-across-External-RDBMS-and-file-system-td4021447.html

Coldfusion Report Builder - How can you set different datasources externally between prod/staging/dev?

Coldfusion Report Builder is great.
One small issue. We use ANT+CFANT to deploy.
When we create the report, say in a datasource called MyApp_dev on a dev box.
Our other server is the production server. It also contains a staging build to ensure everything is going smoothly before we publish to live. (thanks to Al Everett for bringing this clarification to my attention.)
Everything works great when the report is created.
We deploy the report to our staging server, which has a datasource of MyApp_Staging. That server also, may or may not, have the live app working under MyApp_Live. Ant pushes the update to Staging just great.
Run the report, crashes and burns. Why?
It seems the report is looking for the MyApp_Dev data_source, even though the application is using the MyApp_Staging datasource.
In digging around I found a few approaches, I would like to do this one, final, ideal way from the beginning instead of having to go back to do dozens of reports differently when I have a new Aha! moment.
1) Obvious: Pass in the datasource in to the cfreport tag. Doesn't work for ColdFusion Builder Reports as of v8, or v9 as tested on Linux.
2) Most realistic option (but painful) so far: Pass in the query as an object into the ColdFusion Builder report. Let's think about this:
Create the Report with the report builder to my heart's content using the RDS, etc on my local box.
When I'm done, copy the query into a snippet of code, or into a database column to be dynamically be injected at runtime with correct datasource.
Modify my "run report" event to find the query from the database column, insert it into another dynamic cfquery and potentially... evaluate (!?!) it? Fun side is I can set the cfquery datasource to what I would need for each environment.
When I modify the report's columns in CF Report Builder, I always have to update the query in the database. Is there a snippet of code that can extract this for me? Hmm.
3) Less than ideal. Suck it up and let all the reports in staging run off the live server. Maybe copy the live data into staging (sans structural changes) to let it seem similar.
Are there any eloquent ways to accomplish the above?
Thanks in Advance!
If you have different dev/staging/production boxes, why not just use the same datasource name on each? That'll save you from having the code figure out where it is.
Because security concerns at my current assignment preclude me from using RDS, I use option 2 as a matter of course. I also like it as it makes it easier to debug.