Questions tagged [database]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
26 views

How to update from Craft version 2 to 4?

I'm working with a Craft site that's running on version 2.6 and I need to get it updated to the latest version. My first approach was to just start a fresh site and then import the existing database, ...
user avatar
  • 103
0 votes
2 answers
59 views

How to fix corrupted Craft project config files

Looking to get some advice on fixing some issues I'm having with my Craft DEV environment. I merged some changes which worked fine locally, but are causing some issues on my deployed version. Problems ...
user avatar
1 vote
1 answer
54 views

Getting column not found when using 'Entry::find()' to find the matching channel entry in custom plugin

We are building a plugin to perform some custom operations with an ERP system. We created a section for managing the users from ERP. We are able to create new users as channel entries and update them ...
user avatar
1 vote
1 answer
28 views

Increment automatically the number field

I'm building a component in which the value of a number should be increased every 2 hours by 0.1. What would be the best solution for that? I have a field type number with the value 1200 by default. ...
user avatar
  • 151
0 votes
1 answer
54 views

Postgres SSL PDO config for config/db.php

Struggling to configure this correctly and cleanly. When I upgrade to latest 3.x Craft on staging, Craft can no longer connect to the Postgres DB, which uses SSL. Have had success up until CraftCMS ...
user avatar
  • 63
0 votes
0 answers
50 views

Why is my database stuck at the 'Creating sort index' query?

So I imported the production database locally and it is getting stuck at the 'creating sort index' stage of the query when I try to log in to the CMS. This is the Server Process table from SequelAce ...
user avatar
  • 1
2 votes
1 answer
258 views

DB CPU running at 100%, Pages Never Load, Moving from MySQL to MariaDB

I've been running a somewhat busy database (~800Mb) in GCP SQL. Due to the cost of it I've been working on migrating to a custom server running MariaDB. Which I'd heard could be much more cost ...
user avatar
  • 1,369
0 votes
0 answers
20 views

DB Query from specific section

I have a website running on craft 2 and I am having trouble with creating queries in a custom plugin controller. I have a section "tasks" and custom field "ordernr". From the ...
user avatar
  • 1
1 vote
1 answer
78 views

How to retrieve (& output via twig) one key pair of json object stored i a database column

in commerce, all transactions are written into the database, into the table "commerce_transactions". every transactions will result in a row, where different data is the stored into columns. ...
user avatar
  • 319
0 votes
0 answers
18 views

How to dump the db for running testing function

I want to set up the db for running testing function. I don't want to dump the whole db but just with the required table structure and records. Probably need to do it again if any new field has beed ...
user avatar
  • 27
1 vote
0 answers
27 views

Limiting image transform totals in queue?

In order to serve webp images where possible, and different sizes for different screens etc, I created a bunch of image transforms over the weekend - forgetting just how many images we have in the ...
user avatar
0 votes
0 answers
51 views

Craft CMS - General Error: 1364 Field 'id' dosen't have a default value

I'm migrating my craft cms site from shared hosting to vps. I did install all the basic services required by Craft under vps. -> Install LAMP Stack. -> cloned code base from git -> SSL Cert -&...
user avatar
1 vote
1 answer
46 views

Sharing data between Multiple Craft 3 CMS instances

I am not asking about multi-site. Rather, I am curious if there is existing support for "sharing" data across unique Craft 3 installs. For instance, let's say he have 2 Craft 3 installs ...
user avatar
  • 21
0 votes
0 answers
27 views

Character encoding problem when move between PCs

I'm using MAMP PRO to develop site in local environment with Cloud functions for sync. Everything works fine except for character coding of entries' text. Evidently a problem with encoding but I can't ...
user avatar
0 votes
0 answers
23 views

Nitro: location auf databases / can not delete db

I am experiencing some weird behavior with data in my Postgres 11 db in Nitro so I completely want to reinstall it. I used nitro db destroy to remove the complete container, but after creating it ...
user avatar
1 vote
1 answer
111 views

Craft CMS admin intermittent internal server errors

I'm getting intermittent Internal server errors in Craft admin. This has happened out of the blue on an active site. Craft pro 3.041 phperrors.log: PHP Notice: Undefined index: constraint_name in /...
user avatar
1 vote
1 answer
89 views

Migrating Craft CMS 2 to 3

I have a craft CMS 2 codebase that a former developer had made for running on our PHP 5 server. Recently, the server upgraded its PHP version to 7.3 so I am trying to migrate the website to a later ...
user avatar
0 votes
0 answers
76 views

Can someone help me solve for this error message: "Craft can't connect to the database with the credentials...."

Can someone help me solve for this error message: An exception has been thrown during the rendering of a template ("Craft can't connect to the database with the credentials in craft/config/db.php....
user avatar
1 vote
1 answer
23 views

how to write db-commands on custom table (PHP syntax) inside twig file?

if i have a custom table (ct_table) and i have to use MySQLi commands on it using the PHP syntax, it won't work if i put the PHP snippets inside a twig file. So are there any tools or official methods ...
user avatar
  • 125
0 votes
0 answers
65 views

Very slow site speed

Most pages on our large site are taking far too long to load. I have gone through and made some template changes that have been suggested, and currently have been running rebuild search index for over ...
user avatar
0 votes
0 answers
35 views

Error trying to push Craftcms DB from staging to Production

I am having a problem trying to use command php craft copy/db/up prod, when craft starts to push the DB to the production stage it stops at halfway and the website goes down! the error in MySQL is ...
user avatar
0 votes
0 answers
38 views

Extending model from yii\db\ActiveRecord, still get error missing column "dateUpdated" on save()

title says it all. I prefer not to have these columns and I read that these are the only difference between Craft\activeRecord and yii\ActiveRecord, and that extending from yii version should be ...
user avatar
  • 101
1 vote
1 answer
52 views

Reapplying Users and Related Content to Database During Pipeline Promotion

I was on a dev ops call this afternoon and am wondering about the viability of a proposed solution for pushing changes to a Craft product through a dev pipeline. For context, this is for a big company ...
user avatar
1 vote
1 answer
44 views

Craft Script: Environment variable GLOBAL_DB_DRIVER was neither 'mysql' nor 'pgsql'

I keep getting the error Environment variable GLOBAL_DB_DRIVER was neither 'mysql' nor 'pgsql'. Aborting. when trying to pull the database from the production server to staging using Craft Script. I ...
user avatar
  • 139
1 vote
1 answer
72 views

Special characters like ✓ are not being saved in text fields

we have just noticed that characters like ✓ are being saved in the title field but not in plain text fields regardless of the database type (PostgreSQL / MySQL) or field type in the database (text, ...
user avatar
1 vote
1 answer
198 views

How do you change from MySQL 5.7 to MySQL 8 in Nitro on MacOS

I usually use Nitro and docker to run Craft. Nitro created a Docker container with MySQL 5.7. How can I change that version to MySQL 8?
user avatar
0 votes
0 answers
49 views

SQL Queries Performing Full Table Scan

Per the title, our application's db query has from time to time pegged our CPU to the max and taken down the site. Our site has gotten quite large in terms of content and trying to figure out how best ...
user avatar
  • 31
0 votes
0 answers
26 views

Adding A Soft Delete in Craft 2 Entries

I've been thinking of adding a "Soft Delete" or just perhaps a means in which deleting in certain sections (e.g. News) will archive the entry with an update, rather than deleting it. As I ...
user avatar
  • 380
0 votes
0 answers
94 views

Certain Queries Pegging CPU and Causing Production Site to go Down

I read these two posts MySQL CPU pegged on specific query Poor performance on midsized site / Queries without index? and and am in a similar situation although for us it actually breaks our site and ...
user avatar
  • 31
1 vote
1 answer
151 views

MySQL error when sync database using Craft Script from Craft Nitro

I'm trying to sync the database from staging to local (Craft Nitro) using the craft-script as per the article. Here is the error message, Usage: mysqldump [OPTIONS] database [tables] OR mysqldump [...
user avatar
  • 139
0 votes
0 answers
53 views

SyncDB with Nitro Fail to sync database from local to staging

I'm trying to sync the database for my local Craft Nitro to the staging environment using SyncDB. Here is the error, [2021-06-04T15:49:51.623536+08:00] sync.NOTICE: Starting database sync [] [] [2021-...
user avatar
  • 139
1 vote
2 answers
174 views

Unable to backup the database or apply migrations

I'm running CraftCMS via 3 Docker containers in 1 Docker network: Container 1 - MySQL Container 2 - Nginx Container 3 - PHP:7.4-fpm When I run php craft update craft from container 3 and choose to ...
user avatar
  • 111
0 votes
0 answers
243 views

When Using Nitro Add and it gets to the choose database engine question, the choices arent there and typing in doesn't work

I'm totally new at craft cms and nitro and I'm having trouble adding a new site. When I get to the part where it asks you which database engine to use there's no options there to choose from and ...
user avatar
1 vote
2 answers
83 views

Synching content and template files across environments

I'm new to CraftCMS and have a few basic questions about synching contents between local and remote development environments. This has been discussed in other posts by I'm looking for more specific ...
user avatar
  • 157
1 vote
1 answer
27 views

Why does the matrix field produce such a massive amount of duplicate information?

The matrix field in Craft CMS is producing massive quantities of duplicate data. About 70 database rows per entry. Is there something I'm doing wrong? I don't think this will be sustainable for my ...
user avatar
1 vote
0 answers
31 views

Building a yii query for Connect plugin

I'm using the Connect plugin by Andrew Welch to get some data from an external database. Somewhere in the data, I need data from another related table. The way I'm doing this now is like this: {% set ...
user avatar
1 vote
0 answers
193 views

Craft warning: Tried to release a savepoint, but it does not exist

I'm working on a plug-in for Craft 3. For this plug-in is a migration is needed. When this migration runs and adds the entries, fields, and groups then the following warning occurs in the logs. [...
user avatar
2 votes
1 answer
60 views

How to keep staging install synced with member registration

What is the best way to keep live and staging environments synced with member registrations? I can export/import the database from the live to staging environment to keep it in sync - and have a ...
user avatar
  • 700
1 vote
1 answer
92 views

Use Emoji in Title?

I need to be able to store emoji in the title field of several entries, but whenever the entry is saved the emoji characters are stripped out and replaced with four question marks i.e. ????. I imagine ...
user avatar
1 vote
0 answers
73 views

Very slow `INSERT` transactions on the resourcepaths table

After a recent update (Craft 3.4.x to 3.5.x) I'm seeing some suspiciously slow response times in relation to INSERT actions on the resourcepaths table. Some in the upwards of a half second for a ...
user avatar
1 vote
3 answers
162 views

Deleting user data from the database

I'm using Craft 3.6.4.1 and I need to delete a whole tranche of users from the database (that has derived from another Craft instance). I've been deleting by hand via the CMS but note that loads of ...
user avatar
0 votes
0 answers
24 views

Need to populate new field based on existing data

Say I have a section called "Stores" that has an existing field called "Store Hours". The client has populated the store hours for 1000 some stores. Now, however, it seems what the ...
user avatar
  • 121
1 vote
1 answer
211 views

New security key for existing database

I've been hunting through questions here, Discord, Craft docs for solutions for a boilerplate Craft CMS install. Because I want to include section & field configurations, I'm planning on importing ...
user avatar
1 vote
1 answer
102 views

Cannot connect to outside mssql database in production

Error: Craft CMS can’t connect to the database with the credentials in config/db.php. I have two database connections. One to mysql for the bulk of the website including all things craft, and one ...
user avatar
2 votes
1 answer
108 views

Craft CMS: Data too long for column 'cacheKey' at row 1

We have Craft CMS v3 using multi-sites. We are using cache to cache whole pages based on the absolute URL as some URLs have query parameters which seem to be ignored when not using a key. So the ...
user avatar
2 votes
1 answer
162 views

Is there a name for Craft 3's database model?

I find Craft 3 to have a very clever database structure which eschews all of the issues I've seen with EAV. Despite contrasting the differences between Craft 3's model and EAV, I'm having difficulty ...
user avatar
1 vote
1 answer
332 views

Database Exception Column not found: 1054 Unknown column 'configVersion' in 'field list'

I get this Error when i want to save a Field. Also when i want to create a new field. I can hit the goback button and strangely the field gets still saved. I work local and have project config ...
user avatar
  • 213
1 vote
3 answers
437 views

How to delete old content in a Craft CMS database?

I've create 20+ websites in Craft and each time I've always started with the use of another site's database. (time saving to not have to create all fields, sections and more) On my latest site's ...
user avatar
  • 21
1 vote
2 answers
327 views

Deleting Duplicate Fields Brings down Craft Website and Server

I have somehow managed to duplicate some fields in my Craft install (see image of unused fields). When I delete the unused duplicates I create a server error and can't access Craft. To rectify I had ...
user avatar
  • 1,107
1 vote
1 answer
156 views

Database Connection Error after updating from Craft 2 to 3

Good evening all, I am updating a small site from Craft 2 to 3, and after following the instructions in the documents, I loaded up the backend of my site and was greeted with the install screen. I ...
user avatar
  • 419

1
2 3 4 5
8